Compare commits

..

1 Commits

Author SHA1 Message Date
bfd20ea8fb Fixes type errors in the DocumentSearchForm 2025-10-11 18:29:05 -07:00

View File

@@ -62,7 +62,6 @@ export const DocumentSearchInput = ({
?.includes(queryValue.toLowerCase()), ?.includes(queryValue.toLowerCase()),
); );
// TODO: Better form formatting
return ( return (
<BaseForm <BaseForm
title={`Find ${DocumentTypeLabel[docType]}`} title={`Find ${DocumentTypeLabel[docType]}`}
@@ -70,7 +69,7 @@ export const DocumentSearchInput = ({
error={null} error={null}
onSubmit={() => selectedDoc && onSubmit(selectedDoc)} onSubmit={() => selectedDoc && onSubmit(selectedDoc)}
content={ content={
<Combobox <Combobox<AnyDocument | null>
name={searchField} name={searchField}
value={selectedDoc} value={selectedDoc}
onChange={(doc) => { onChange={(doc) => {
@@ -80,7 +79,7 @@ export const DocumentSearchInput = ({
> >
<ComboboxInput <ComboboxInput
displayValue={(doc: AnyDocument) => displayValue={(doc: AnyDocument) =>
doc && getField(doc, searchField) (doc && getField(doc, searchField)) ?? "(no value)"
} }
onChange={(event) => setQueryValue(event.target.value)} onChange={(event) => setQueryValue(event.target.value)}
className={`w-full p-2 rounded border bg-slate-800 text-slate-100 border-slate-700 focus:outline-none focus:ring-2 focus:ring-violet-500 transition-colors`} className={`w-full p-2 rounded border bg-slate-800 text-slate-100 border-slate-700 focus:outline-none focus:ring-2 focus:ring-violet-500 transition-colors`}