This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
packages/common/src/components/form Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 useController ,
99 UseControllerProps ,
1010} from "react-hook-form" ;
11- import { type OptionType } from "../../../types/common" ;
1211import { truncatedText } from "../../../styles/styledComponentUtils" ;
1312import { removeRefParam } from "../../reservation-form/util" ;
1413
@@ -29,6 +28,10 @@ interface PopulateTimesProps {
2928 intervalMinutes ?: number ;
3029}
3130
31+ type OptionType = {
32+ label : string ;
33+ value : number ;
34+ } ;
3235const StyledSelect = styled ( Select < OptionType > ) `
3336 button {
3437 display: grid;
@@ -83,8 +86,8 @@ const TimeRangePicker = <T extends FieldValues>({
8386 const getSelectedOption = (
8487 optionValue : string | null ,
8588 optionList : OptionType [ ]
86- ) : OptionType | undefined => {
87- return optionList . find ( ( o ) => o . label === optionValue ) ;
89+ ) : OptionType | null => {
90+ return optionList . find ( ( o ) => o . label === optionValue ) ?? null ;
8891 } ;
8992 const populateTimes = (
9093 populateTimesProps ?: PopulateTimesProps
You can’t perform that action at this time.
0 commit comments