(e: SyntheticEvent, detail: InputOnChangeData | TextAreaProps | DropdownProps | CheckboxProps, type: string)
| 79 | }); |
| 80 | |
| 81 | const handleChange = (e: SyntheticEvent, detail: InputOnChangeData | TextAreaProps | DropdownProps | CheckboxProps, type: string) => { |
| 82 | const value = detail.value; |
| 83 | |
| 84 | if (type === 'clientAvailability') { |
| 85 | toggleInfo[type] = detail.value === 'yes'; |
| 86 | } else if ( type === 'permanent' ) { |
| 87 | toggleInfo[type] = detail.name === 'permanent-yes'; |
| 88 | } else { |
| 89 | // @ts-ignore detail value |
| 90 | toggleInfo[type] = value; |
| 91 | } |
| 92 | |
| 93 | saveToggleInfo({...toggleInfo}); |
| 94 | }; |
| 95 | |
| 96 | return { |
| 97 | toggleInfo, |