diff --git a/src/app/room/classChat/ChatHeader.tsx b/src/app/room/classChat/ChatHeader.tsx index 324267b..07163b4 100644 --- a/src/app/room/classChat/ChatHeader.tsx +++ b/src/app/room/classChat/ChatHeader.tsx @@ -2,7 +2,18 @@ import { Input } from "@/components/ui/input"; import { useContext, useState } from "react"; -import { PanelRightClose, Users, GraduationCap, Search, X, UserPlus, Undo2 } from "lucide-react"; +import { + PanelRightClose, + Users, + GraduationCap, + Search, + X, + UserPlus, + Undo2, + VolumeOff, + Volume2, + BellRing, +} from "lucide-react"; import ManageTAsModal from "./ManageTAsModal"; import { useMediaQuery } from "@/hooks/use-media-query"; import { SlideUpdateContext } from "../SlideUpdateContext"; @@ -15,6 +26,8 @@ const TITLE_MAX_CHARS = 6; interface ChatHeaderProps { role: Role; answerMode: "all" | "instructors_only"; + notificationMode: "off" | "sound" | "browser"; + onToggleNotificationMode: () => void; onToggleAnswerMode: () => void; searchQuery: string; onSearchChange: (value: string) => void; @@ -55,6 +68,8 @@ function SlideToggle() { export default function ChatHeader({ role, answerMode, + notificationMode, + onToggleNotificationMode, onToggleAnswerMode, searchQuery, onSearchChange, @@ -63,6 +78,24 @@ export default function ChatHeader({ const { isSlidesVisible } = useContext(SlideUpdateContext); const [isSearchExpanded, setIsSearchExpanded] = useState(false); const [showTAModal, setShowTAModal] = useState(false); + const notificationButton = + notificationMode === "off" + ? { + Icon: VolumeOff, + title: "Notifications off", + className: "bg-red-100 text-red-700 hover:bg-red-200", + } + : notificationMode === "sound" + ? { + Icon: Volume2, + title: "Beep notifications on", + className: "bg-stone-200 text-stone-600 hover:bg-stone-300", + } + : { + Icon: BellRing, + title: "Browser and beep notifications on", + className: "bg-amber-100 text-amber-700 hover:bg-amber-200", + }; return ( <> @@ -126,8 +159,17 @@ export default function ChatHeader({
+