2023-02-28 08:30:57 +00:00
|
|
|
import * as React from "react";
|
|
|
|
import { GridColDef } from "@mui/x-data-grid";
|
|
|
|
import DataGrid from "@kitUI/datagrid";
|
2023-03-06 13:26:55 +00:00
|
|
|
import { usePrivilegeStore } from "@stores/privileges";
|
|
|
|
|
2023-02-28 08:30:57 +00:00
|
|
|
|
|
|
|
const columns: GridColDef[] = [
|
2023-03-06 13:26:55 +00:00
|
|
|
{ field: 'id', headerName: 'id', width: 40 },
|
2023-02-28 08:30:57 +00:00
|
|
|
{ field: 'name', headerName: 'Привелегия', width: 150 },
|
|
|
|
{ field: 'description', headerName: 'Описание', width: 550 },//инфо из гитлаба.
|
|
|
|
{ field: 'type', headerName: 'Тип', width: 150 },
|
|
|
|
{ field: 'price', headerName: 'Стоимость', width: 50 }
|
2023-03-06 13:26:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
export default function PrivilegesDG() {
|
|
|
|
const privileges = usePrivilegeStore(state => state.privileges);
|
2023-02-28 08:30:57 +00:00
|
|
|
|
2023-03-06 13:26:55 +00:00
|
|
|
const privilegesGridData = privileges.map(privilege => ({
|
|
|
|
id: privilege.privilegeId,
|
|
|
|
name: privilege.name,
|
|
|
|
description: privilege.description,
|
|
|
|
type: privilege.type,
|
|
|
|
price: privilege.pricePerUnit,
|
|
|
|
}));
|
2023-02-28 08:30:57 +00:00
|
|
|
|
2023-03-06 13:26:55 +00:00
|
|
|
return (
|
2023-02-28 08:30:57 +00:00
|
|
|
<DataGrid
|
2023-03-06 13:26:55 +00:00
|
|
|
// checkboxSelection={true}
|
|
|
|
rows={privilegesGridData}
|
|
|
|
columns={columns}
|
2023-02-28 08:30:57 +00:00
|
|
|
/>
|
2023-03-06 13:26:55 +00:00
|
|
|
);
|
2023-02-28 08:30:57 +00:00
|
|
|
}
|