Download src/components/forms/DocumentSelect.tsx from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/components/forms/DocumentSelect.tsx
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/src/components/forms/DocumentSelect.tsx
-
curl -L -o DocumentSelect.tsx https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/components/forms/DocumentSelect.tsx
1.01 kB
| import type { ApiDocument } from "@/lib/api/types"; | |
| type DocumentSelectProps = { | |
| documents: ApiDocument[]; | |
| selectedDocumentId: string; | |
| onChange: (documentId: string) => void; | |
| label?: string; | |
| }; | |
| export function DocumentSelect({ documents, selectedDocumentId, onChange, label = "Choose source" }: DocumentSelectProps) { | |
| return ( | |
| <label className="workspace-card block p-4"> | |
| <span className="text-[13px] font-semibold text-[var(--text-primary)]">{label}</span> | |
| <select | |
| className="mt-2.5 h-10 w-full rounded-[var(--radius-sm)] border border-[var(--border-subtle)] bg-[var(--bg-root)] px-3 text-[13px] font-medium text-[var(--text-secondary)] outline-none transition focus:border-[var(--accent-primary)]" | |
| value={selectedDocumentId} | |
| onChange={(event) => onChange(event.target.value)} | |
| > | |
| {documents.map((document) => ( | |
| <option key={document.id} value={document.id}>{document.title}</option> | |
| ))} | |
| </select> | |
| </label> | |
| ); | |
| } | |