import { StarIcon } from '@heroicons/react/24/outline'; import { getCollection, getMetaobjectsByIds } from 'lib/shopify'; import { Collection, Metaobject } from 'lib/shopify/types'; import Link from 'next/link'; const { STORE_PREFIX } = process.env; const validStores = ['car-part-planet', 'reman-engine', 'engine-locator']; const LinkBlock = async ({ collectionId, title }: { collectionId?: string; title?: string }) => { if (!collectionId || !title) return null; const collection = await getCollection({ id: collectionId }); if (!collection) return null; return (
{title}
); }; const EngineSizes = async ({ collection }: { collection: Collection }) => { if (!collection.plpType || !validStores.includes(STORE_PREFIX!)) { return null; } let engineSizes = [] as Metaobject[]; if (collection.plpType === 'Product Type' && collection.engineSizeLinks) { engineSizes = await getMetaobjectsByIds(collection.engineSizeLinks); } if (!engineSizes.length) { return null; } return (

Browse Engines By Engine Sizes

Popular Engine Sizes

{engineSizes.map((engineSize) => ( ))}
); }; export default EngineSizes;