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

Simplify code, use standard attributes

This commit is contained in:
viown 2025-01-15 14:11:12 +03:00
parent 23c9e75dd2
commit 1dede0ce2b
2 changed files with 19 additions and 22 deletions

View file

@ -1,6 +1,6 @@
import React, { FunctionComponent } from 'react';
import type { LogFile } from '@jellyfin/sdk/lib/generated-client/models/log-file';
import { Box, List, ListItem, ListItemButton, ListItemText, useTheme } from '@mui/material';
import { List, ListItem, ListItemButton, ListItemText } from '@mui/material';
import { useApi } from 'hooks/useApi';
import datetime from 'scripts/datetime';
@ -10,7 +10,6 @@ type LogItemProps = {
const LogItemList: FunctionComponent<LogItemProps> = ({ logs }: LogItemProps) => {
const { api } = useApi();
const theme = useTheme();
const getLogFileUrl = (logFile: LogFile) => {
if (!api) return '';
@ -29,8 +28,7 @@ const LogItemList: FunctionComponent<LogItemProps> = ({ logs }: LogItemProps) =>
};
return (
<Box sx={{ backgroundColor: theme.palette.background.paper }}>
<List>
<List sx={{ bgcolor: 'background.paper' }}>
{logs.map(log => {
return (
<ListItem key={log.Name} disablePadding>
@ -46,7 +44,6 @@ const LogItemList: FunctionComponent<LogItemProps> = ({ logs }: LogItemProps) =>
);
})}
</List>
</Box>
);
};

View file

@ -121,9 +121,9 @@ const Logs = () => {
</Button>
</Stack>
</Form>
<Stack className='serverLogs readOnlyContent' spacing={1} sx={{ mt: 1 }}>
<Box className='serverLogs readOnlyContent' sx={{ mt: 1 }}>
<LogItemList logs={logs} />
</Stack>
</Box>
</Box>
</Page>
);