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:
parent
97f703f7d7
commit
834e36b5a3
6 changed files with 157 additions and 98 deletions
|
@ -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}` :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue