diff --git a/src/Components/FormInputMain.jsx b/src/Components/FormInputMain.jsx index 411c737..ad1bd11 100644 --- a/src/Components/FormInputMain.jsx +++ b/src/Components/FormInputMain.jsx @@ -15,7 +15,8 @@ const FormInputMain = ({ submitTitle, p, w, - btnLoading + btnLoading, + btnhidden, }) => { return ( @@ -91,7 +92,7 @@ const FormInputMain = ({ {children} - + {onCancle && ( + {btnhidden ? ( + "" + ) : ( + + )} diff --git a/src/Constants/Constants.js b/src/Constants/Constants.js index 16ac5bf..931a3a2 100644 --- a/src/Constants/Constants.js +++ b/src/Constants/Constants.js @@ -1,4 +1,12 @@ export const getFileNameFromPath = (filePath) => { - const parts = filePath.split('/'); - return parts[parts.length - 1]; - }; \ No newline at end of file + const parts = filePath.split("/"); + return parts[parts.length - 1]; +}; + +export function debounce(func, delay) { + let debounceTimer; + return function (...args) { + clearTimeout(debounceTimer); + debounceTimer = setTimeout(() => func.apply(this, args), delay); + }; +} diff --git a/src/Pages/IO_Management/KeyMeritsAdd.jsx b/src/Pages/IO_Management/KeyMeritsAdd.jsx index 53d48d7..3bf0b2c 100644 --- a/src/Pages/IO_Management/KeyMeritsAdd.jsx +++ b/src/Pages/IO_Management/KeyMeritsAdd.jsx @@ -116,7 +116,7 @@ const KeyMeritsAdd = ({ isOpen, onClose, firstField, id }) => { @@ -197,7 +197,7 @@ const KeyMeritsAdd = ({ isOpen, onClose, firstField, id }) => { - + + + - + - + + + - + - - - ), - })) + + + + + ), + })); - const handleDelete = () => { - const IOtype = investmentType.filter( - (investmentType) => investmentType.id !== actionId - ); + // ==================== [Delete Function] ======================= - setTimeout(() => { - setInvestmentType(IOtype); - setDeleteAlert(false); - setIsLoading(false); - }, 100); + const handleDelete = async () => { + console.log(actionId); setIsLoading(true); + try { + const response = await deleteInvestmentType(actionId); + console.log(response); + setIsLoading(false); + setDeleteAlert(false); + } catch (error) {} }; return ( @@ -241,6 +210,9 @@ const InvestmentType = () => { pt={4} spacing="24px" > + + {/* ======================= [Search Input] ======================== */} + { /> + + {/* ==================== [Pagination] ===================== */} + + {/* ===================== [Add Button] ===================== */} + - */} - {