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,7 +675,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
body: 'flex flex-col gap-6', body: 'flex flex-col gap-6',
}} }}
> >
<div className='grid grid-cols-1 md:grid-cols-2 gap-6'> <div className={type === 'detail' ? 'flex flex-col gap-6' : 'grid grid-cols-1 md:grid-cols-2 gap-6'}>
{type === 'detail' ? null : (
<SelectInput <SelectInput
required required
label='Lokasi' label='Lokasi'
@@ -684,11 +685,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
options={locationOptions} options={locationOptions}
onInputChange={setLocationSearchValue} onInputChange={setLocationSearchValue}
isLoading={isLoadingLocations} isLoading={isLoadingLocations}
isDisabled={type === 'detail'}
placeholder='Pilih Lokasi' placeholder='Pilih Lokasi'
isClearable isClearable
isSearchable isSearchable
/> />
)}
<div> <div>
<SelectInput <SelectInput