Fixes type errors in the DocumentSearchForm
This commit is contained in:
@@ -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`}
|
||||||
|
|||||||
Reference in New Issue
Block a user