1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/apps/dashboard/components/drawer/sections/DevicesDrawerSection.tsx

73 lines
2.7 KiB
TypeScript
Raw Normal View History

2022-11-28 16:39:13 -05:00
import { Devices, Analytics, Input, ExpandLess, ExpandMore } from '@mui/icons-material';
import Collapse from '@mui/material/Collapse';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import ListSubheader from '@mui/material/ListSubheader';
import React from 'react';
import { useLocation } from 'react-router-dom';
import ListItemLink from 'components/ListItemLink';
2022-11-28 16:39:13 -05:00
import globalize from 'scripts/globalize';
const DLNA_PATHS = [
2023-09-25 00:00:36 -04:00
'/dashboard/dlna',
'/dashboard/dlna/profiles'
2022-11-28 16:39:13 -05:00
];
const DevicesDrawerSection = () => {
const location = useLocation();
const isDlnaSectionOpen = DLNA_PATHS.includes(location.pathname);
return (
<List
aria-labelledby='devices-subheader'
subheader={
<ListSubheader component='div' id='devices-subheader'>
{globalize.translate('HeaderDevices')}
</ListSubheader>
}
>
<ListItem disablePadding>
2023-09-25 00:00:36 -04:00
<ListItemLink to='/dashboard/devices'>
2022-11-28 16:39:13 -05:00
<ListItemIcon>
<Devices />
</ListItemIcon>
<ListItemText primary={globalize.translate('HeaderDevices')} />
</ListItemLink>
</ListItem>
<ListItem disablePadding>
2023-06-09 03:01:27 -04:00
<ListItemLink to='/dashboard/activity'>
2022-11-28 16:39:13 -05:00
<ListItemIcon>
<Analytics />
</ListItemIcon>
<ListItemText primary={globalize.translate('HeaderActivity')} />
</ListItemLink>
</ListItem>
<ListItem disablePadding>
2023-09-25 00:00:36 -04:00
<ListItemLink to='/dashboard/dlna' selected={false}>
2022-11-28 16:39:13 -05:00
<ListItemIcon>
<Input />
</ListItemIcon>
<ListItemText primary={'DLNA'} />
{isDlnaSectionOpen ? <ExpandLess /> : <ExpandMore />}
</ListItemLink>
</ListItem>
<Collapse in={isDlnaSectionOpen} timeout='auto' unmountOnExit>
<List component='div' disablePadding>
2023-09-25 00:00:36 -04:00
<ListItemLink to='/dashboard/dlna' sx={{ pl: 4 }}>
2022-11-28 16:39:13 -05:00
<ListItemText inset primary={globalize.translate('Settings')} />
</ListItemLink>
2023-09-25 00:00:36 -04:00
<ListItemLink to='/dashboard/dlna/profiles' sx={{ pl: 4 }}>
2022-11-28 16:39:13 -05:00
<ListItemText inset primary={globalize.translate('TabProfiles')} />
</ListItemLink>
</List>
</Collapse>
</List>
);
};
export default DevicesDrawerSection;