import { Head } from '@inertiajs/react'; import { StorefrontRenderer } from '@/storefront/renderer'; import { fontStylesheetUrl, storefrontTitlePrefix } from '@/storefront/theme'; import type { FontMap, ShopInfo, StoreCart, StorePlan, StoreProduct, StorefrontView, } from '@/storefront/types'; export default function PreviewStore({ storeName, language, plan, fonts, baseUrl, preview, view, products, cart, shop, featuredProducts, }: { storeName: string; language: string; plan: StorePlan; fonts: FontMap; baseUrl: string; /** True in the owner's preview, false on the live store. */ preview: boolean; view: StorefrontView; products: StoreProduct[]; cart: StoreCart; shop: ShopInfo; featuredProducts: Record; }) { const fontUrl = fontStylesheetUrl(plan.theme, fonts); const page = view.type === 'page' && view.pageId !== 'home' ? plan.pages.find((candidate) => candidate.id === view.pageId) : undefined; const title = view.type === 'product' ? view.product.name : page ? `${page.title} - ${storeName}` : storeName; return ( <> {fontUrl && } ); }