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:
parent
78f9a1f4e8
commit
ad053d6656
3 changed files with 56 additions and 28 deletions
46
src/apps/dashboard/components/TablePage.tsx
Normal file
46
src/apps/dashboard/components/TablePage.tsx
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue