Иконка редактирования для DataGrid
This commit is contained in:
parent
607887bce8
commit
da04d31591
@ -4,6 +4,7 @@ import { GridColDef, GridSelectionModel, GridToolbar } from "@mui/x-data-grid";
|
||||
import { Box, Button, IconButton } from "@mui/material";
|
||||
import BackspaceIcon from "@mui/icons-material/Backspace";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import ModeEditOutlineOutlinedIcon from "@mui/icons-material/ModeEditOutlineOutlined";
|
||||
|
||||
import DataGrid from "@kitUI/datagrid";
|
||||
|
||||
@ -197,6 +198,28 @@ export default function TariffsDG({ selectedTariffs, handleSelectionChange }: Pr
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "edit",
|
||||
headerName: "Изменение",
|
||||
width: 60,
|
||||
renderCell: ({ row }) => {
|
||||
return (
|
||||
<>
|
||||
<IconButton onClick={() => setOpenEditModal(true)}>
|
||||
<ModeEditOutlineOutlinedIcon />
|
||||
</IconButton>
|
||||
<EditModal
|
||||
tariffEdit={tariffEdit}
|
||||
errorEdit={errorEdit}
|
||||
tariff={row}
|
||||
selectedTariffPrivilege={row.pprivilege}
|
||||
open={openEditModal}
|
||||
handleClose={() => setOpenEditModal(false)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const privilegiesName = (array: Privilege[]) => {
|
||||
@ -227,8 +250,6 @@ export default function TariffsDG({ selectedTariffs, handleSelectionChange }: Pr
|
||||
}));
|
||||
|
||||
const selectedTariff = gridData.find((tariff) => tariff.id === selectedTariffs[0]);
|
||||
const selectedTariffName = selectedTariff ? selectedTariff.name : "";
|
||||
|
||||
const selectedTariffPrivilege = selectedTariff ? selectedTariff.privilege : [];
|
||||
|
||||
const allName = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user