[portal] add required field for companies typeahead

pull/421/head
Yangshun Tay 2 years ago
parent 4e0e9d0f9e
commit 5844c52efe

@ -9,6 +9,7 @@ type Props = Readonly<{
isLabelHidden?: boolean; isLabelHidden?: boolean;
onSelect: (option: TypeaheadOption) => void; onSelect: (option: TypeaheadOption) => void;
placeHolder?: string; placeHolder?: string;
required?: boolean;
}>; }>;
export default function CompaniesTypeahead({ export default function CompaniesTypeahead({
@ -16,6 +17,7 @@ export default function CompaniesTypeahead({
onSelect, onSelect,
isLabelHidden, isLabelHidden,
placeHolder, placeHolder,
required,
}: Props) { }: Props) {
const [query, setQuery] = useState(''); const [query, setQuery] = useState('');
const companies = trpc.useQuery([ const companies = trpc.useQuery([
@ -42,6 +44,7 @@ export default function CompaniesTypeahead({
})) ?? [] })) ?? []
} }
placeholder={placeHolder} placeholder={placeHolder}
required={required}
onQueryChange={setQuery} onQueryChange={setQuery}
onSelect={onSelect} onSelect={onSelect}
/> />

Loading…
Cancel
Save