Files
yt-dlp-webui/frontend/src/components/Logout.tsx
marcobaobao 2f0afe27cc removed --no-mtime and -x switches in settings
Custom templates are powerful: --no-mtime has been set as default behavior (template named default), -x is another template named "audio only"
2024-06-07 10:08:32 +02:00

24 lines
621 B
TypeScript

import LogoutIcon from '@mui/icons-material/Logout'
import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
import { useNavigate } from 'react-router-dom'
import { useI18n } from '../hooks/useI18n'
export default function Logout() {
const navigate = useNavigate()
const logout = async () => {
localStorage.removeItem('token')
navigate('/login')
}
const { i18n } = useI18n()
return (
<ListItemButton onClick={logout}>
<ListItemIcon>
<LogoutIcon />
</ListItemIcon>
<ListItemText primary={i18n.t('rpcAuthenticationLabel')} />
</ListItemButton>
)
}