diff --git a/web/components/kefu/chat-shell.tsx b/web/components/kefu/chat-shell.tsx index 8ea6558..91cec48 100644 --- a/web/components/kefu/chat-shell.tsx +++ b/web/components/kefu/chat-shell.tsx @@ -4,6 +4,7 @@ import { HeadphonesIcon, Maximize2Icon, Minimize2Icon, + MoreHorizontalIcon, MinusIcon, RotateCwIcon, XIcon, @@ -42,6 +43,12 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" import { cn } from "@/lib/utils" const windowActionButtonClass = @@ -62,6 +69,16 @@ function WindowActionButton({ ) } +function getMobileStatusDotClass(status: string) { + if (status === "connected") { + return "bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]" + } + if (status === "connecting") { + return "bg-amber-500 shadow-[0_0_0_3px_rgba(245,158,11,0.16)]" + } + return "bg-muted-foreground shadow-[0_0_0_3px_rgba(148,163,184,0.14)]" +} + function useKefuSystemTheme() { useLayoutEffect(() => { if (typeof window === "undefined") { @@ -279,22 +296,85 @@ export function KefuChatShell() { style={{ "--primary": themeColor } as CSSProperties} >
-
+
-
+
-
- {title} +
+
-
+
{subtitle}
-
+
+ {!isEmbedded && status !== "connected" ? ( + + + + ) : null} + {isEmbedded ? ( + + } + > + + + + + + 重新连接 + + + + 收起窗口 + + + {isMaximized ? ( + + ) : ( + + )} + {isMaximized ? "取消最大化" : "最大化"} + + setIsCloseDialogOpen(true)} + > + + 关闭窗口 + + + + ) : ( + setIsCloseDialogOpen(true)} + aria-label="关闭聊天窗口" + title="关闭聊天窗口" + className="hover:bg-rose-50 hover:text-rose-600 dark:hover:bg-rose-950/45 dark:hover:text-rose-300" + > + + + )} +
+
{status !== "connected" ? ( ) : null}