refactor(FE): Refactor CustomerPaymentTab to use filterParams instead of

formik values
This commit is contained in:
rstubryan
2026-03-05 11:01:52 +07:00
parent b5fc1d4310
commit 267ef9d812
@@ -119,7 +119,6 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
},
});
// Set the ref callback after formik is initialized
handleFilterModalOpenRef.current = () => {
filterModal.openModal();
formik.validateForm();
@@ -360,15 +359,12 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
(state) => state.clearTabActions
);
const formikValuesRef = useRef(formik.values);
formikValuesRef.current = formik.values;
useEffect(() => {
setTabActions(
tabId,
<div className='flex flex-row gap-3'>
<ButtonFilter
values={formikValuesRef.current}
values={filterParams}
fieldGroups={[['start_date', 'end_date']]}
onClick={() => handleFilterModalOpenRef.current()}
variant='outline'
@@ -449,7 +445,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
handleExportPdf,
isExcelExportLoading,
isPdfExportLoading,
formik.values,
filterParams,
]);
const TabActionsElement = useMemo(() => <TabActions />, [TabActions]);