diff --git a/src/components/message.tsx b/src/components/message.tsx index fb29cb3..ab4286f 100644 --- a/src/components/message.tsx +++ b/src/components/message.tsx @@ -1,4 +1,4 @@ -import { ActionIcon, Box, Paper, Textarea, Tooltip } from "@mantine/core"; +import { ActionIcon, Box, Paper, Tooltip } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { IconEye, IconEyeOff, IconTrash } from "@tabler/icons-react"; import { useEffect, useMemo, useState } from "react"; @@ -37,63 +37,59 @@ export default function Message({ data, onDelete }: IMessageProps) { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + console.log(data); + return ( - - - - - {data.recipient.length > 0 && {data.recipient}} - - - {dayjs(data.time).format("HH:mm D/M/YYYY")} - - - - - - - - - {show ? : } - - - - - - - + + + + + + {data.recipient_name.length > 0 && ( + {data.recipient_name} + )} + + + {dayjs(data.time).format("HH:mm D/M/YYYY")} + - - {/* - - {data.sender.split("@")[0] - ? `From: ${data.sender.split("@")[0]}` - : ""} - - */} - - + + + {data.sender_name || ""}:{" "} + + {messageContent} + + + + + + + {show ? : } + + + + + + + + + + + + ); } diff --git a/src/pages/main.tsx b/src/pages/main.tsx index 5c0d1a1..cd6f30d 100644 --- a/src/pages/main.tsx +++ b/src/pages/main.tsx @@ -6,7 +6,7 @@ import { LoadingOverlay, ScrollAreaAutosize, Tooltip, - useMantineColorScheme + useMantineColorScheme, } from "@mantine/core"; import { useDisclosure, useViewportSize } from "@mantine/hooks"; // 🔥 thêm cái nà y import { IconDotsVertical } from "@tabler/icons-react"; @@ -22,7 +22,7 @@ function MainPage() { const { height } = useViewportSize(); // lấy kÃch thước cá»a sổ const [clickMessage, setClickMessage] = useState(null); - const {colorScheme} = useMantineColorScheme(); + const { colorScheme } = useMantineColorScheme(); const scrollToBottom = () => { const viewport = viewportRef.current; @@ -96,7 +96,11 @@ function MainPage() { return ( {/* Header */} - + {/* { @@ -112,7 +116,7 @@ function MainPage() { */} -{/* + {/* Zulip Notes */}