mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-04 18:21:58 +00:00
32 lines
822 B
TypeScript
32 lines
822 B
TypeScript
|
|
import { DataGrid, type DataGridProps, type GridValidRowModel } from "@mui/x-data-grid";
|
||
|
|
|
||
|
|
type InvoiceDataGridProps<R extends GridValidRowModel> = DataGridProps<R> & {
|
||
|
|
"data-testid": string;
|
||
|
|
};
|
||
|
|
|
||
|
|
export function InvoiceDataGrid<R extends GridValidRowModel>({
|
||
|
|
"data-testid": testId,
|
||
|
|
...props
|
||
|
|
}: InvoiceDataGridProps<R>) {
|
||
|
|
return (
|
||
|
|
<div data-testid={testId}>
|
||
|
|
<DataGrid
|
||
|
|
autoHeight
|
||
|
|
disableColumnMenu
|
||
|
|
disableRowSelectionOnClick
|
||
|
|
pageSizeOptions={[10, 25]}
|
||
|
|
initialState={{
|
||
|
|
pagination: { paginationModel: { pageSize: 10, page: 0 } },
|
||
|
|
}}
|
||
|
|
getRowId={(row) => row.id as string}
|
||
|
|
sx={{
|
||
|
|
border: 1,
|
||
|
|
borderColor: "divider",
|
||
|
|
backgroundColor: "background.paper",
|
||
|
|
}}
|
||
|
|
{...props}
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|