feat: add manufacturer section

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe
2024-06-14 17:31:30 +07:00
parent c5af5b3069
commit 3ac4b140c9
6 changed files with 109 additions and 49 deletions

View File

@@ -1,16 +1,19 @@
import ImageDisplay from 'components/page/image-display';
import { Metaobject } from 'lib/shopify/types';
import Link from 'next/link';
import { Suspense } from 'react';
import { twMerge } from 'tailwind-merge';
const ManufacturerItem = ({
manufacturer,
className
className,
href
}: {
manufacturer: Metaobject;
className?: string;
href?: string;
}) => {
return (
const children = (
<div className={twMerge('flex w-full flex-row items-center justify-between', className)}>
<span className="text-sm leading-5">{manufacturer.display_name}</span>
<div className="hidden md:block">
@@ -25,6 +28,11 @@ const ManufacturerItem = ({
</div>
</div>
);
if (href) {
return <Link href={href}>{children}</Link>;
}
return children;
};
export default ManufacturerItem;