refactor(FE-137): conditionally render location SelectInput in RecordingForm based on type

This commit is contained in:
rstubryan
2025-10-27 06:50:48 +07:00
parent 9143248e1d
commit 943c0e05b9
@@ -675,20 +675,21 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
body: 'flex flex-col gap-6',
}}
>
<div className='grid grid-cols-1 md:grid-cols-2 gap-6'>
<SelectInput
required
label='Lokasi'
value={selectedLocation}
onChange={locationChangeHandler}
options={locationOptions}
onInputChange={setLocationSearchValue}
isLoading={isLoadingLocations}
isDisabled={type === 'detail'}
placeholder='Pilih Lokasi'
isClearable
isSearchable
/>
<div className={type === 'detail' ? 'flex flex-col gap-6' : 'grid grid-cols-1 md:grid-cols-2 gap-6'}>
{type === 'detail' ? null : (
<SelectInput
required
label='Lokasi'
value={selectedLocation}
onChange={locationChangeHandler}
options={locationOptions}
onInputChange={setLocationSearchValue}
isLoading={isLoadingLocations}
placeholder='Pilih Lokasi'
isClearable
isSearchable
/>
)}
<div>
<SelectInput