diff --git a/src/frontend/src/components/Avatar.tsx b/src/frontend/src/components/Avatar.tsx index 6f0af42f..70308b59 100644 --- a/src/frontend/src/components/Avatar.tsx +++ b/src/frontend/src/components/Avatar.tsx @@ -1,40 +1,51 @@ -import { css } from '@/styled-system/css' +import { cva, RecipeVariantProps } from '@/styled-system/css' import React from 'react' -export type AvatarProps = React.HTMLAttributes & { - name?: string - size?: number - bgColor?: string - textColor?: string -} +const avatar = cva({ + base: { + backgroundColor: 'transparent', + color: 'white', + display: 'flex', + borderRadius: '50%', + justifyContent: 'center', + alignItems: 'center', + userSelect: 'none', + cursor: 'default', + flexGrow: 0, + flexShrink: 0, + }, + variants: { + context: { + list: { + width: '32px', + height: '32px', + fontSize: '0.8rem', + }, + placeholder: { + width: '100%', + height: '100%', + }, + }, + }, + defaultVariants: { + context: 'list', + }, +}) -export const Avatar = ({ - name, - size = 32, - bgColor, - textColor = 'white', -}: AvatarProps) => { +export type AvatarProps = React.HTMLAttributes & { + name?: string + bgColor?: string +} & RecipeVariantProps + +export const Avatar = ({ name, bgColor, context, ...props }: AvatarProps) => { const initial = name?.trim()?.charAt(0).toUpperCase() || '' return (
{initial}
diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx b/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx index 07f51301..b37bb15a 100644 --- a/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx +++ b/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx @@ -30,9 +30,18 @@ export const ParticipantPlaceholder = ({ style={{ borderRadius: '50%', animation: isSpeaking ? 'pulse 1s infinite' : undefined, + width: '80%', + maxWidth: '150px', + height: 'auto', + aspectRatio: '1/1', + fontSize: '50px', }} > - + )