This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e04088c
commit 6af4cfb
Showing
6 changed files
with
929 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Paper, Stack, Typography } from '@mui/material'; | ||
|
||
export type MessageType = { | ||
content: string; | ||
sentByYou: boolean; | ||
color: string; | ||
}; | ||
|
||
export default function Message({ message }: { message: MessageType }) { | ||
return ( | ||
<Paper | ||
elevation={3} | ||
style={{ | ||
width: 'fit-content', | ||
marginLeft: message.sentByYou ? 'auto' : undefined, | ||
}} | ||
> | ||
<Stack | ||
padding={2} | ||
style={{ | ||
width: 'fit-content', | ||
}} | ||
> | ||
<Typography | ||
style={{ | ||
color: message.color, | ||
}} | ||
> | ||
{message.sentByYou ? 'Du: ' : 'Boss: '} | ||
{message.content} | ||
</Typography> | ||
</Stack> | ||
</Paper> | ||
); | ||
} |
Oops, something went wrong.