diff --git a/client/src/components/Sagi/ChatHub.tsx b/client/src/components/Sagi/ChatHub.tsx index be6d641d..80c40eae 100644 --- a/client/src/components/Sagi/ChatHub.tsx +++ b/client/src/components/Sagi/ChatHub.tsx @@ -9,7 +9,8 @@ * demand, text with links, pasted / dropped / attached files (images shown * inline, anything else a download, all served only to the room's members), * and for a group its settings — the creator renames it and adds or removes - * people; anyone may leave. `NewChat` picks people: one person opens the + * people; anyone may leave. `ChatNotice` is the card a new message raises on + * the pet while its window is closed. `NewChat` picks people: one person opens the * direct chat with them, more (or a name) makes a group. Only a room's members * ever see it; an admin has no view of other people's chats. * @author Nguyễn Ngọc Trí Vĩ @@ -112,6 +113,47 @@ const Badge = ({ n }: { n: number }) => ) : null; +/** A new message from someone, on the pet while its window is closed: opens the room. */ +export function ChatNotice({ + notice, + onOpen, + onDismiss, +}: { + notice: NonNullable; + onOpen: (roomId: number) => void; + onDismiss: () => void; +}) { + const { t } = useTranslation("settings"); + return ( +
+ + +
+ ); +} + /** The column beside the window: the pet, the rooms, and New chat. */ export function ChatRail({ chat, @@ -131,7 +173,7 @@ export function ChatRail({ on ? "ring-2 ring-accent ring-offset-2 ring-offset-surface-2" : "opacity-80 hover:opacity-100"; return (