feat: add support chat widget demo and state management
- Implemented SupportWidgetDemo component for configuring and mounting the support chat widget. - Introduced Zustand store for managing support chat state, including message handling and socket connection. - Created support host bridge for communication between the widget and parent window. - Added utility functions for JWT token generation and local storage management. - Enhanced user experience with notifications for new messages and chat status updates.
This commit is contained in:
@@ -7,7 +7,7 @@ import { z } from "zod/v4"
|
||||
import { CopyIcon, ExternalLinkIcon } from "lucide-react"
|
||||
import { toast } from "sonner"
|
||||
|
||||
import { getWidgetDemoPath } from "@/components/kefu/demo-navigation"
|
||||
import { getWidgetDemoPath } from "@/components/support-chat/demo-navigation"
|
||||
import { OptionCombobox } from "@/components/option-combobox"
|
||||
import { ProjectDialog } from "@/components/project-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function Page() {
|
||||
<CheckCircle2Icon className="size-7" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<h1 className="text-lg font-semibold text-foreground">{t("kefu.closedTitle")}</h1>
|
||||
<h1 className="text-lg font-semibold text-foreground">{t("supportChat.closedTitle")}</h1>
|
||||
<p className="text-sm leading-6 text-muted-foreground">
|
||||
{t("kefu.closedDescription")}
|
||||
{t("supportChat.closedDescription")}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { KefuChatShell } from "@/components/kefu/chat-shell"
|
||||
import { SupportChatShell } from "@/components/support-chat/chat-shell"
|
||||
|
||||
export default function Page() {
|
||||
return <KefuChatShell />
|
||||
return <SupportChatShell />
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { KefuWidgetDemo } from "@/components/kefu/widget-demo"
|
||||
import { SupportWidgetDemo } from "@/components/support-chat/widget-demo"
|
||||
|
||||
export default function Page() {
|
||||
return <KefuWidgetDemo />
|
||||
return <SupportWidgetDemo />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user