adminFront/src/pages/dashboard/ModalUser/PurchaseTab.tsx

107 lines
2.2 KiB
TypeScript
Raw Normal View History

2023-07-25 07:47:20 +00:00
import { DataGrid } from "@mui/x-data-grid";
import { useTheme } from "@mui/material";
import type { GridColDef } from "@mui/x-data-grid";
const COLUMNS: GridColDef[] = [
{
2023-07-25 13:07:06 +00:00
field: "date",
headerName: "Дата",
width: 200,
2023-07-25 07:47:20 +00:00
sortable: false,
},
{
2023-07-25 13:07:06 +00:00
field: "time",
headerName: "Время",
width: 180,
2023-07-25 07:47:20 +00:00
sortable: false,
},
{
2023-07-25 13:07:06 +00:00
field: "product",
headerName: "Товар",
width: 280,
2023-07-25 07:47:20 +00:00
sortable: false,
},
{
2023-07-25 13:07:06 +00:00
field: "amount",
headerName: "Кол-во",
width: 70,
2023-07-25 07:47:20 +00:00
sortable: false,
},
];
const ROWS = [
{
id: "row_1",
2023-07-25 13:07:06 +00:00
date: "19.02.2023",
time: "17:01",
product: "Шаблонизатор",
amount: "1 шт.",
2023-07-25 07:47:20 +00:00
},
{
id: "row_2",
2023-07-25 13:07:06 +00:00
date: "28.02.2023",
time: "10:43",
product: "Шаблонизатор",
amount: "1 шт.",
2023-07-25 07:47:20 +00:00
},
{
id: "row_3",
2023-07-25 13:07:06 +00:00
date: "04.03.2023",
time: "21:09",
product: "Сокращатель ссылок",
amount: "2 шт.",
2023-07-25 07:47:20 +00:00
},
];
export const PurchaseTab = () => {
const theme = useTheme();
return (
<DataGrid
rows={ROWS}
columns={COLUMNS}
pageSize={5}
rowsPerPageOptions={[5]}
2023-07-25 13:07:06 +00:00
hideFooter
disableColumnMenu
2023-07-25 07:47:20 +00:00
disableSelectionOnClick
2023-07-25 13:07:06 +00:00
rowHeight={50}
headerHeight={50}
2023-07-25 07:47:20 +00:00
experimentalFeatures={{ newEditingApi: true }}
sx={{
2023-07-25 13:07:06 +00:00
borderRadius: "0",
border: "none",
"& .MuiDataGrid-columnHeaders": {
padding: "0 25px",
background: "#F2F3F7",
borderBottom: "none",
},
"& .MuiDataGrid-main .MuiDataGrid-columnHeader": {
outline: "none",
},
"& .MuiDataGrid-columnHeaderTitle": {
fontWeight: "bold",
userSelect: "none",
},
"& .MuiDataGrid-virtualScrollerRenderZone": {
width: "100%",
2023-07-25 07:47:20 +00:00
},
2023-07-25 13:07:06 +00:00
"& .MuiDataGrid-iconSeparator": { display: "none" },
"& .MuiDataGrid-main .MuiDataGrid-cell": {
outline: "none",
border: "none",
justifyContent: "flex-start",
2023-07-25 07:47:20 +00:00
},
2023-07-25 13:07:06 +00:00
"& .MuiDataGrid-row": {
padding: "0 25px",
width: "100%",
"&:hover": {
background: "#F2F3F7",
},
2023-07-25 07:47:20 +00:00
},
}}
/>
);
};