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}
placeholder='Pilih Produk'
placeholder={
!formik.values.project_flock_kandang_id
? 'Pilih kandang terlebih dahulu'
: 'Pilih Produk'
}
isLoading={isLoadingStockProducts}
onMenuScrollToBottom={loadMoreStockProducts}
isError={
@@ -2465,7 +2469,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
wrapper: 'w-full min-w-48',
}}
isSearchable
isDisabled={type === 'detail'}
isDisabled={
type === 'detail' ||
!formik.values.project_flock_kandang_id
}
isClearable={type !== 'detail'}
startAdornment={
stock.product_warehouse_id