refactor KefuChatShell component by removing unused host actions state and simplifying button rendering

This commit is contained in:
mlogclub
2026-04-27 14:52:14 +08:00
parent b4e26d2359
commit 15d0d81fa1
-8
View File
@@ -75,7 +75,6 @@ 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,
@@ -142,9 +141,6 @@ export function KefuChatShell() {
useEffect(() => {
return bindKefuHostBridge({
onInit: () => {
setShowHostActions(true)
},
onOpen: () => {
setIsOpen(true)
setIsVisible(true)
@@ -265,7 +261,6 @@ export function KefuChatShell() {
>
<RotateCwIcon className="size-4" />
</Button>
{showHostActions ? (
<Button
type="button"
variant="outline"
@@ -277,8 +272,6 @@ export function KefuChatShell() {
>
<MinusIcon className="size-4" />
</Button>
) : null}
{showHostActions ? (
<Button
type="button"
variant="outline"
@@ -294,7 +287,6 @@ export function KefuChatShell() {
<Maximize2Icon className="size-4" />
)}
</Button>
) : null}
<Button
type="button"
variant="outline"