mirror of
https://github.com/vercel/commerce.git
synced 2025-05-12 20:57:51 +00:00
22 lines
671 B
TypeScript
22 lines
671 B
TypeScript
import { getCollection } from 'lib/shopify';
|
|
|
|
const Header = async ({ collection }: { collection: string }) => {
|
|
const collectionData = await getCollection({ handle: collection });
|
|
|
|
return collectionData ? (
|
|
<div className="mb-3 mt-3 max-w-5xl lg:mb-1">
|
|
<h1 className="text-4xl font-bold tracking-tight text-gray-900">{collectionData.title}</h1>
|
|
<p className="mt-2 text-base text-gray-500">{collectionData.description}</p>
|
|
</div>
|
|
) : null;
|
|
};
|
|
|
|
export const HeaderPlaceholder = () => {
|
|
return (
|
|
<div className="mb-3 mt-3 max-w-5xl lg:mb-1">
|
|
<div className="h-10 w-1/2 rounded bg-gray-200" />
|
|
</div>
|
|
);
|
|
};
|
|
export default Header;
|