refactor(FE): Disable product select until kandang chosen

This commit is contained in:
rstubryan
2026-01-26 09:41:50 +07:00
parent 860a2d988e
commit 56326cc8d2
@@ -2444,7 +2444,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
); );
}} }}
options={unifiedStockProducts} options={unifiedStockProducts}
placeholder='Pilih Produk' placeholder={
!formik.values.project_flock_kandang_id
? 'Pilih kandang terlebih dahulu'
: 'Pilih Produk'
}
isLoading={isLoadingStockProducts} isLoading={isLoadingStockProducts}
onMenuScrollToBottom={loadMoreStockProducts} onMenuScrollToBottom={loadMoreStockProducts}
isError={ isError={
@@ -2465,7 +2469,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
wrapper: 'w-full min-w-48', wrapper: 'w-full min-w-48',
}} }}
isSearchable isSearchable
isDisabled={type === 'detail'} isDisabled={
type === 'detail' ||
!formik.values.project_flock_kandang_id
}
isClearable={type !== 'detail'} isClearable={type !== 'detail'}
startAdornment={ startAdornment={
stock.product_warehouse_id stock.product_warehouse_id