mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
20 lines
525 B
JavaScript
20 lines
525 B
JavaScript
import { getCollections } from 'lib/shopify';
|
|
|
|
import { HomeProductsList } from '/components/home';
|
|
|
|
export async function generateStaticParams() {
|
|
const collections = await getCollections();
|
|
|
|
const params = collections
|
|
.map(collection => ({
|
|
collection: collection.handle,
|
|
}))
|
|
.filter(param => param.collection.length > 0);
|
|
|
|
return params;
|
|
}
|
|
|
|
export default async function CollectionPage({ params: { collection } }) {
|
|
return <HomeProductsList collection={collection} />;
|
|
}
|