import { useState, type ReactNode } from 'react'; import { ImageOff } from 'lucide-react'; /** * The pieces every Store user page is built from. * * Copied — deliberately, and once — from the Store Admin pages rather than * invented, so the two workspaces are the same product seen from two heights. * The values are not arbitrary: 32px controls, radius 12, 13px labels, centred * table cells and a soft chip in the row's own colour are the corrections the * merchant pages already went through. */ /* The sixth and last copy of `TabButton` lived here, exported for the Store user pages. Every one of them now imports `components/TabBar`. */ /** A header action drawn like the tabs, so the two rows read as one bar. */ export function BarAction({ label, icon, onClick, isDisabled, }: { label: string; icon: ReactNode; onClick: () => void; isDisabled?: boolean; }) { const [isHovered, setIsHovered] = useState(false); return ( ); } /** * A column heading. * * `align` defaults to centre because every store-user table was built that * way and changing them all is not this prop's job. Pass `"end"` for a column * of numbers: a figure is read against the ones above and below it, and that * only works when the digits line up on the right. */ export function Th({ children, align = 'center', }: { children?: ReactNode; align?: 'start' | 'center' | 'end'; }) { return ( {children} ); } export function Td({ children, isMuted, isStrong, align = 'center', }: { children: ReactNode; isMuted?: boolean; isStrong?: boolean; align?: 'start' | 'center' | 'end'; }) { return ( {children} ); } /** Soft fill, 26% border, in its own colour — the console's one status chip. */ export function Chip({ label, color }: { label: string; color: string }) { return ( {label} ); } /** * A 40px pack shot. * * `mix-blend-multiply` because catalogue photography is shot on white — without * it every thumbnail carries a grey square where the photo's ground meets the * row. */ export function Thumb({ images, alt }: { images: readonly string[]; alt: string }) { const [failed, setFailed] = useState(false); const src = images[0]; return ( {src && !failed ? ( {alt} setFailed(true)} style={{ width: '100%', height: '100%', objectFit: 'contain', mixBlendMode: 'multiply' }} /> ) : ( )} ); }