commerce/components/plp/content.tsx
Chloe f8ef1b6350
address Hanna reviews
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
2024-07-08 22:17:38 +07:00

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;