Files
jellyfin-web/src/components/toolbar/ServerButton.tsx
T
2025-04-11 01:17:09 -04:00

39 lines
957 B
TypeScript

import icon from '@jellyfin/ux-web/icon-transparent.png';
import Button from '@mui/material/Button/Button';
import React, { FC } from 'react';
import { Link } from 'react-router-dom';
import { useSystemInfo } from 'hooks/useSystemInfo';
const ServerButton: FC = () => {
const {
data: systemInfo,
isPending
} = useSystemInfo();
return (
<Button
variant='text'
size='large'
color='inherit'
startIcon={
<img
src={icon}
alt=''
aria-hidden
style={{
maxHeight: '1.25em',
maxWidth: '1.25em'
}}
/>
}
component={Link}
to='/'
>
{isPending ? '' : (systemInfo?.ServerName || 'Jellyfin')}
</Button>
);
};
export default ServerButton;