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

Move distinct components to individual files

This commit is contained in:
Bill Thornton 2023-06-27 01:31:50 -04:00
parent 97f703f7d7
commit 834e36b5a3
6 changed files with 157 additions and 98 deletions

View file

@ -7,17 +7,15 @@ import { useApi } from 'hooks/useApi';
interface UserAvatarProps {
user?: UserDto
showTitle?: boolean
}
const UserAvatar: FC<UserAvatarProps> = ({ user, showTitle = false }) => {
const UserAvatar: FC<UserAvatarProps> = ({ user }) => {
const { api } = useApi();
const theme = useTheme();
return user ? (
<Avatar
alt={user.Name ?? undefined}
title={showTitle && user.Name ? user.Name : undefined}
src={
api && user.Id && user.PrimaryImageTag ?
`${api.basePath}/Users/${user.Id}/Images/Primary?tag=${user.PrimaryImageTag}` :