mirror of
https://github.com/vercel/commerce.git
synced 2025-05-12 12:47:50 +00:00
20 lines
537 B
TypeScript
20 lines
537 B
TypeScript
import { getMetaobject } from 'lib/shopify';
|
|
import { Collection } from 'lib/shopify/types';
|
|
import DefaultContent from './default-content';
|
|
import DynamicContent from './dynamic-content';
|
|
|
|
const Content = async ({ collection }: { collection: Collection }) => {
|
|
if (!collection.dynamicContent) {
|
|
return <DefaultContent />;
|
|
}
|
|
|
|
const content = await getMetaobject({ id: collection.dynamicContent });
|
|
if (!content) {
|
|
return <DefaultContent />;
|
|
}
|
|
|
|
return <DynamicContent content={content} />;
|
|
};
|
|
|
|
export default Content;
|