build cms ok,

This commit is contained in:
2025-05-23 17:16:47 +08:00
parent 50fc385c2b
commit a94ead44ba
41 changed files with 395 additions and 83 deletions

View File

@@ -17,6 +17,7 @@ const user = {
name: 'Sofia Rivers',
avatar: '/assets/avatar.png',
email: 'sofia@devias.io',
collectionId: '123321',
} satisfies User;
export interface MessageBoxProps {
@@ -38,8 +39,14 @@ export function MessageBox({ message }: MessageBoxProps): React.JSX.Element {
mr: position === 'left' ? 'auto' : 0,
}}
>
<Avatar src={message.author.avatar} sx={{ '--Avatar-size': '32px' }} />
<Stack spacing={1} sx={{ flex: '1 1 auto' }}>
<Avatar
src={message.author.avatar}
sx={{ '--Avatar-size': '32px' }}
/>
<Stack
spacing={1}
sx={{ flex: '1 1 auto' }}
>
<Card
sx={{
px: 2,
@@ -52,7 +59,11 @@ export function MessageBox({ message }: MessageBoxProps): React.JSX.Element {
>
<Stack spacing={1}>
<div>
<Link color="inherit" sx={{ cursor: 'pointer' }} variant="subtitle2">
<Link
color="inherit"
sx={{ cursor: 'pointer' }}
variant="subtitle2"
>
{message.author.name}
</Link>
</div>
@@ -66,14 +77,21 @@ export function MessageBox({ message }: MessageBoxProps): React.JSX.Element {
/>
) : null}
{message.type === 'text' ? (
<Typography color="inherit" variant="body1">
<Typography
color="inherit"
variant="body1"
>
{message.content}
</Typography>
) : null}
</Stack>
</Card>
<Box sx={{ display: 'flex', justifyContent: position === 'right' ? 'flex-end' : 'flex-start', px: 2 }}>
<Typography color="text.secondary" noWrap variant="caption">
<Typography
color="text.secondary"
noWrap
variant="caption"
>
{dayjs(message.createdAt).fromNow()}
</Typography>
</Box>