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',
}}
>
<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
required
label='Lokasi'
@@ -684,11 +685,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
options={locationOptions}
onInputChange={setLocationSearchValue}
isLoading={isLoadingLocations}
isDisabled={type === 'detail'}
placeholder='Pilih Lokasi'
isClearable
isSearchable
/>
)}
<div>
<SelectInput