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, type ComponentProps } from "react"import { useDropzone, type FileRejection } from "react-dropzone"import { Dropzone, DropzoneContent, DropzoneEmptyState } from "@/components/dropzone"const MAX_FILES = 3const MAX_FILE_SIZE = 5 * 1000 * 1000const ALLOWED_TYPES = ["image/*", "application/pdf"]export default function DropzoneDemo() { const [files, setFiles] = useState<any[]>([]) const [successes, setSuccesses] = useState<string[]>([]) const [errors, setErrors] = useState<{ name: string; message: string }[]>([]) const [loading, setLoading] = useState(false) const dropzone = useDropzone({ noClick: true, maxFiles: MAX_FILES, maxSize: MAX_FILE_SIZE, multiple: true, accept: Object.fromEntries(ALLOWED_TYPES.map((type) => [type, []])), onDrop: (accepted: File[], rejected: FileRejection[]) => { setFiles((prev) => [ ...prev, ...accepted .filter((file) => !prev.some((p) => p.name === file.name)) .map((file) => Object.assign(file, { preview: URL.createObjectURL(file), errors: [] })), ...rejected.map(({ file, errors }) => Object.assign(file, { preview: URL.createObjectURL(file), errors }) ), ]) }, }) const onUpload = async () => { setLoading(true) await new Promise((resolve) => setTimeout(resolve, 800)) setSuccesses(files.map((file) => file.name)) setLoading(false) } const isSuccess = files.length > 0 && successes.length === files.length && errors.length === 0 const props = { ...dropzone, files, setFiles, successes, isSuccess, loading, errors, setErrors, onUpload, maxFiles: MAX_FILES, maxFileSize: MAX_FILE_SIZE, allowedMimeTypes: ALLOWED_TYPES, } as unknown as ComponentProps<typeof Dropzone> return ( <div className="w-full max-w-md"> <Dropzone {...props}> <DropzoneEmptyState /> <DropzoneContent /> </Dropzone> </div> )}