From c20bea533b2b14e25233268c541e4f69c57bf840 Mon Sep 17 00:00:00 2001 From: "MSI\\2Fi" Date: Fri, 6 Dec 2024 15:54:06 +0800 Subject: [PATCH] relocate action to the right most --- .../TimeLeaveModal/TimeLeaveInputTable.tsx | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/components/TimeLeaveModal/TimeLeaveInputTable.tsx b/src/components/TimeLeaveModal/TimeLeaveInputTable.tsx index 57e1be3..5df4577 100644 --- a/src/components/TimeLeaveModal/TimeLeaveInputTable.tsx +++ b/src/components/TimeLeaveModal/TimeLeaveInputTable.tsx @@ -278,38 +278,6 @@ const TimeLeaveInputTable: React.FC = ({ const columns = useMemo( () => [ - { - type: "actions", - field: "actions", - headerName: t("Actions"), - getActions: ({ id }) => { - if (rowModesModel[id]?.mode === GridRowModes.Edit) { - return [ - } - label={t("Save")} - onClick={handleSave(id)} - />, - } - label={t("Cancel")} - onClick={handleCancel(id)} - />, - ]; - } - - return [ - } - label={t("Remove")} - onClick={handleDelete(id)} - />, - ]; - }, - }, { field: "projectId", editable: true, @@ -606,6 +574,38 @@ const TimeLeaveInputTable: React.FC = ({ return {params.value}; }, }, + { + type: "actions", + field: "actions", + headerName: t("Actions"), + getActions: ({ id }) => { + if (rowModesModel[id]?.mode === GridRowModes.Edit) { + return [ + } + label={t("Save")} + onClick={handleSave(id)} + />, + } + label={t("Cancel")} + onClick={handleCancel(id)} + />, + ]; + } + + return [ + } + label={t("Remove")} + onClick={handleDelete(id)} + />, + ]; + }, + }, ], [ t,