From 14f220619fd67911520c41e7c5de4d0e14f72ff3 Mon Sep 17 00:00:00 2001 From: mlogclub Date: Fri, 24 Apr 2026 22:40:34 +0800 Subject: [PATCH] feat: add host actions visibility control in KefuChatShell --- web/components/kefu/chat-shell.tsx | 52 +++++++++++++++++------------- web/lib/kefu-host-bridge.ts | 2 ++ 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/web/components/kefu/chat-shell.tsx b/web/components/kefu/chat-shell.tsx index 8183fcb..c6c3327 100644 --- a/web/components/kefu/chat-shell.tsx +++ b/web/components/kefu/chat-shell.tsx @@ -29,6 +29,7 @@ export function KefuChatShell() { const [isMaximized, setIsMaximized] = useState(false) const [isCloseDialogOpen, setIsCloseDialogOpen] = useState(false) const [isClosingConversation, setIsClosingConversation] = useState(false) + const [showHostActions, setShowHostActions] = useState(false) const { title, @@ -95,6 +96,9 @@ export function KefuChatShell() { useEffect(() => { return bindKefuHostBridge({ + onInit: () => { + setShowHostActions(true) + }, onOpen: () => { setIsOpen(true) setIsVisible(true) @@ -214,28 +218,32 @@ export function KefuChatShell() { > - - + {showHostActions ? ( + + ) : null} + {showHostActions ? ( + + ) : null}