mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-30 21:53:28 +08:00
[portal][ui] allow value to be specified for comapnies and job titles typeahead
This commit is contained in:
@ -11,6 +11,7 @@ type Props = Readonly<{
|
||||
onSelect: (option: TypeaheadOption | null) => void;
|
||||
placeholder?: string;
|
||||
required?: boolean;
|
||||
value?: TypeaheadOption | null;
|
||||
}>;
|
||||
|
||||
export default function CompaniesTypeahead({
|
||||
@ -19,6 +20,7 @@ export default function CompaniesTypeahead({
|
||||
isLabelHidden,
|
||||
placeholder,
|
||||
required,
|
||||
value,
|
||||
}: Props) {
|
||||
const [query, setQuery] = useState('');
|
||||
const companies = trpc.useQuery([
|
||||
@ -47,6 +49,7 @@ export default function CompaniesTypeahead({
|
||||
placeholder={placeholder}
|
||||
required={required}
|
||||
textSize="inherit"
|
||||
value={value}
|
||||
onQueryChange={setQuery}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
|
@ -10,6 +10,7 @@ type Props = Readonly<{
|
||||
onSelect: (option: TypeaheadOption | null) => void;
|
||||
placeholder?: string;
|
||||
required?: boolean;
|
||||
value?: TypeaheadOption | null;
|
||||
}>;
|
||||
|
||||
export default function JobTitlesTypeahead({
|
||||
@ -18,6 +19,7 @@ export default function JobTitlesTypeahead({
|
||||
isLabelHidden,
|
||||
placeholder,
|
||||
required,
|
||||
value,
|
||||
}: Props) {
|
||||
const [query, setQuery] = useState('');
|
||||
const options = Object.entries(JobTitleLabels)
|
||||
@ -42,6 +44,7 @@ export default function JobTitlesTypeahead({
|
||||
placeholder={placeholder}
|
||||
required={required}
|
||||
textSize="inherit"
|
||||
value={value}
|
||||
onQueryChange={setQuery}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user