adminFront/src/pages/dashboard/Content/Tariffs/privilegesDG.tsx

34 lines
1.1 KiB
TypeScript
Raw Normal View History

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";
const columns: GridColDef[] = [
2023-03-06 13:26:55 +00:00
{ field: 'id', headerName: 'id', width: 40 },
{ 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-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-03-06 13:26:55 +00:00
return (
<DataGrid
2023-03-06 13:26:55 +00:00
// checkboxSelection={true}
rows={privilegesGridData}
columns={columns}
/>
2023-03-06 13:26:55 +00:00
);
}