import { ChevronRightIcon } from '@heroicons/react/24/solid'; import RichTextDisplay from 'components/page/rich-text-display'; import Table from 'components/page/table'; import { getMetaobject } from 'lib/shopify'; import startCase from 'lodash.startcase'; import { Tab, TabGroup, TabList, TabPanel, TabPanels } from './tab-components'; const TabContent = async ({ id }: { id?: string }) => { if (!id) { return null; } const metaobject = await getMetaobject({ id }); if (!metaobject || metaobject.type !== 'plp_content_tables') return null; return ( ); }; const Tabs = ({ fields }: { fields: { [key: string]: string } }) => { const keys = Object.keys(fields); if (!keys.length) { return null; } const isShopifyId = (value?: string) => value?.startsWith('gid://shopify'); return (
{keys.map((key) => ( {startCase(key)} ))} {keys.map((key) => ( {isShopifyId(fields[key]) ? ( ) : ( )} ))}
); }; export const TabsPlaceholder = () => { return (
); }; export default Tabs;