Skip to content

Commit

Permalink
frontend: Fix MessageBox
Browse files Browse the repository at this point in the history
  • Loading branch information
StreetLamb committed Apr 22, 2024
1 parent bcedcf3 commit a82191a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions frontend/src/components/Teams/ChatTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,16 @@ const stream = async (id: number, data: TeamChat) => {
}

const MessageBox = ({ message }: { message: Message }) => {
const memberName = message.member.slice(0, message.member.lastIndexOf("-"))
const nextMemberName =
message.next?.lastIndexOf("-") !== -1
? message.next?.slice(0, message.next?.lastIndexOf("-"))
: message.next
const { member, next, content } = message
return (
<VStack spacing={0} my={8}>
<Container fontWeight={"bold"} display={"flex"} alignItems="center">
{memberName}
{nextMemberName && <Icon as={GrFormNextLink} mx={2} />}
{nextMemberName && nextMemberName}
{member}
{next && <Icon as={GrFormNextLink} mx={2} />}
{next && next}
</Container>
<Container>
<Markdown>{message.content}</Markdown>
<Markdown>{content}</Markdown>
</Container>
</VStack>
)
Expand Down

0 comments on commit a82191a

Please sign in to comment.