mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Refactor api keys to use TablePage component
This commit is contained in:
parent
1e61a4a7b3
commit
d7595a7454
3 changed files with 42 additions and 59 deletions
|
@ -1,4 +1,5 @@
|
|||
import Box from '@mui/material/Box/Box';
|
||||
import Stack from '@mui/material/Stack/Stack';
|
||||
import Typography from '@mui/material/Typography/Typography';
|
||||
import { type MRT_RowData, type MRT_TableInstance, MaterialReactTable } from 'material-react-table';
|
||||
import React from 'react';
|
||||
|
@ -7,6 +8,7 @@ import Page, { type PageProps } from 'components/Page';
|
|||
|
||||
interface TablePageProps<T extends MRT_RowData> extends PageProps {
|
||||
title: string
|
||||
subtitle?: string
|
||||
table: MRT_TableInstance<T>
|
||||
}
|
||||
|
||||
|
@ -27,6 +29,7 @@ export const DEFAULT_TABLE_OPTIONS = {
|
|||
|
||||
const TablePage = <T extends MRT_RowData>({
|
||||
title,
|
||||
subtitle,
|
||||
table,
|
||||
children,
|
||||
...pageProps
|
||||
|
@ -44,7 +47,8 @@ const TablePage = <T extends MRT_RowData>({
|
|||
height: '100%'
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
<Stack
|
||||
spacing={2}
|
||||
sx={{
|
||||
marginBottom: 1
|
||||
}}
|
||||
|
@ -52,7 +56,12 @@ const TablePage = <T extends MRT_RowData>({
|
|||
<Typography variant='h2'>
|
||||
{title}
|
||||
</Typography>
|
||||
</Box>
|
||||
{subtitle && (
|
||||
<Typography>
|
||||
{subtitle}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
<MaterialReactTable table={table} />
|
||||
</Box>
|
||||
{children}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue