Pipeline
- Docsusage, props, keywords
- Demosrc/demo.tsx
- Buildshadcn add → vite
- Capturelight, dark, motion
- IndexBM25 + vectors
Public log. Prompts, raw model errors and costs stay on the admin side.
Log
Demo source
src/demo.tsx · from an earlier run
import { useState } from "react"import { CartDrawer, CartDrawerClose, CartDrawerContent, CartDrawerTrigger, CartEmpty, CartLine, CartLines, CartShippingProgress, CartSummary } from "@/components/ui/cart-drawer"export default function CartDrawerDemo() { const [host, setHost] = useState<HTMLDivElement | null>(null) const [items, setItems] = useState([ { id: "overshirt", name: "Linen Overshirt", variant: "Sand / M", price: 68, quantity: 1 }, { id: "tote", name: "Canvas Tote", variant: "Natural", price: 24, quantity: 2 }, ]) const subtotal = items.reduce((sum, item) => sum + item.price * item.quantity, 0) const count = items.reduce((sum, item) => sum + item.quantity, 0) const update = (id: string, quantity: number) => setItems((list) => list.map((item) => (item.id === id ? { ...item, quantity } : item))) const remove = (id: string) => setItems((list) => list.filter((item) => item.id !== id)) return ( <div ref={setHost} className="relative h-[420px] w-full max-w-2xl overflow-hidden"> <CartDrawer defaultOpen currency="USD" locale="en-US"> <div className="p-4"> <CartDrawerTrigger>Cart</CartDrawerTrigger> </div> {host && ( <CartDrawerContent container={host} count={count}> {items.length > 0 ? ( <> <CartLines> {items.map((item) => ( <CartLine key={item.id} name={item.name} variant={item.variant} price={item.price} quantity={item.quantity} onQuantityChange={(q) => update(item.id, q)} onRemove={() => remove(item.id)} /> ))} </CartLines> <CartSummary subtotal={subtotal}> <CartShippingProgress subtotal={subtotal} threshold={150} /> </CartSummary> </> ) : ( <CartEmpty action={<CartDrawerClose>Continue shopping</CartDrawerClose>} /> )} </CartDrawerContent> )} </CartDrawer> </div> )}