1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add TablePage component

This commit is contained in:
Bill Thornton 2024-08-29 13:50:26 -04:00
parent 78f9a1f4e8
commit ad053d6656
3 changed files with 56 additions and 28 deletions

View file

@ -0,0 +1,46 @@
import Box from '@mui/material/Box/Box';
import Typography from '@mui/material/Typography/Typography';
import { type MRT_RowData, type MRT_TableInstance, MaterialReactTable } from 'material-react-table';
import React from 'react';
import Page, { type PageProps } from 'components/Page';
interface TablePageProps<T extends MRT_RowData> extends PageProps {
title: string
table: MRT_TableInstance<T>
}
const TablePage = <T extends MRT_RowData>({
title,
table,
...pageProps
}: TablePageProps<T>) => {
return (
<Page
title={title}
{...pageProps}
>
<Box
className='content-primary'
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%'
}}
>
<Box
sx={{
marginBottom: 1
}}
>
<Typography variant='h2'>
{title}
</Typography>
</Box>
<MaterialReactTable table={table} />
</Box>
</Page>
);
};
export default TablePage;