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
"use client";import { useState } from 'react';import { FilterPanel } from '@/components/filter-panel/filter-panel';import type { FilterCategory, FilterValue } from '@/components/filter-panel/types';type Product = { id: number; name: string; brand: string; inStock: boolean;};const items: Product[] = [ { id: 1, name: 'Trail Runner', brand: 'northwind', inStock: true }, { id: 2, name: 'City Sneaker', brand: 'contoso', inStock: false }, { id: 3, name: 'Summit Boot', brand: 'northwind', inStock: true }, { id: 4, name: 'Court Classic', brand: 'fabrikam', inStock: true }, { id: 5, name: 'River Sandal', brand: 'contoso', inStock: true },];const categories: FilterCategory<Product>[] = [ { id: 'brand', label: 'Brand', type: 'checkbox-list', options: [ { value: 'northwind', label: 'Northwind' }, { value: 'contoso', label: 'Contoso' }, { value: 'fabrikam', label: 'Fabrikam' }, ], predicate: (item, value) => (value as string[]).includes(item.brand), }, { id: 'inStock', label: 'In stock only', type: 'toggle', isEmpty: (value) => value !== true, predicate: (item) => item.inStock, }, { id: 'name', label: 'Name', type: 'text', placeholder: 'Search products', predicate: (item, value) => item.name.toLowerCase().includes((value as string).toLowerCase()), },];export default function FilterPanelDemo() { const [values, setValues] = useState<Record<string, FilterValue>>({ brand: ['northwind'], }); return ( <FilterPanel<Product> items={items} categories={categories} values={values} onChange={setValues} ariaLabel='Filters' className='w-full max-w-sm' /> );}