Files
sent-shop/components/build-box/BuildBoxCustomizePage.tsx
2026-01-19 20:21:14 +01:00

21 lines
694 B
TypeScript

import { getBoxProducts } from "lib/shopify";
import { BoxOption } from "./BuildBoxCustomizeClient";
import { BuildBoxCustomizePageContent } from "./client/BuildBoxCustomizePageContent";
export async function BuildBoxCustomizePage() {
// Fetch boxes from the API
const boxes = await getBoxProducts({
sortKey: 'CREATED_AT',
reverse: true
});
// Convert products to box options for display
const boxOptions: BoxOption[] = boxes.map(box => ({
id: box.id,
title: box.title,
price: parseFloat(box.priceRange.minVariantPrice.amount),
image: box.featuredImage?.url || '/placeholder-box.jpg'
}));
return <BuildBoxCustomizePageContent boxes={boxOptions} />;
}