import type { ReactNode } from 'react' import Box from '@mui/material/Box' import Stack from '@mui/material/Stack' import { alpha } from '@mui/material/styles' type Author = 'admin' | 'user' type Props = { authorType: Author avatar?: ReactNode children: ReactNode } export function ChatMessageBubble({ authorType, avatar, children }: Props) { const isAdmin = authorType === 'admin' return ( {isAdmin && avatar && {avatar}} isAdmin ? alpha(theme.palette.grey[500], theme.palette.mode === 'dark' ? 0.28 : 0.14) : alpha(theme.palette.primary.main, theme.palette.mode === 'dark' ? 0.28 : 0.1), }} > {children} {!isAdmin && avatar && {avatar}} ) }