import { Menu as Sitemap, Shell } from 'kit/ui/chrome.jsx';
import { configure } from 'kit/ui/config.js';
import site from '../site.json';
import { cdnUrl, grid, money, ogUrl, tileUrl } from './shop.ts';
configure(site);
const CATEGORIES = [
['accessories', 'Accessories'],
['bags', 'Bags'],
['kids', 'Kids'],
['men', 'Men'],
['unisex', 'Unisex'],
['women', 'Women'],
];
/* SHELL */
export function Page({ route, nav, controls, wide, children }) {
return (
{children}
);
}
/* PIECES */
function Card({ product, width = 600, eager = false, pick = 0 }) {
const image = product.images.length ? product.images[pick % product.images.length] : null;
return (
{image ? (
) : (
)}
{product.title}
{money(product.price)}
);
}
function Gallery({ products, eager = 0 }) {
return (
{products.map((product, i) => (
))}
);
}
export function Filter({ label, count, next }) {
return (
<>
{`${label} (${count})`}
- All
{CATEGORIES.map(([slug, name]) => (
- {name}
))}
>
);
}
function Deck({ cards }) {
return (
);
}
/* HOME */
export function Home({ products, lead }) {
return (
<>
>
);
}
/* COLLECTIONS */
export function Collections({ groups, lead }) {
return (
<>
{groups.map((group) => (
))}
>
);
}
export function Collection({ name, products }) {
return (
<>
{name}
{`${products.length} design${products.length === 1 ? '' : 's'}`}
>
);
}
/* PRODUCT */
export function Product({ product, siblings, collection, files, tiles }) {
const images = product.images;
return (
<>
{images.map((image, i) => (
))}
{tiles.map((n) => (
))}
Download
{files.map((name) => (
{name}
))}
{tiles.map((n) => (
{`${n}x${n}`}
))}
og
Designs
>
);
}
export function Controls({ product, printful, sizes, index, total, buy, expires, live }) {
return (
<>
{money(product.price)}
{sizes.length > 1 && (
{sizes.map((size) => (
))}
)}
Buy now
{`${index + 1} / ${total}`}
View on Printful
>
);
}
/* CART */
export function Cart() {
return (
<>
Cart
>
);
}
/* PAGES */
export function Menu({ tree }) {
return (
<>
Menu
Every page on {site.name}.
>
);
}
export function Doc({ title, lead, body, hero, action }) {
return (
<>
{hero && (
)}
{action && (
)}
{body && }
>
);
}
export function NotFound() {
return (
);
}