import * as React from "react"; import { cn } from "@/lib/utils"; import { ThemeProvider } from "@/lib/theme-provider"; import { Card, CardContent } from "@/components/ui/card"; import { BrandColorField, type BrandColorMode, } from "@/components/ui/brand-color-field"; import { ChatWidgetWindow } from "@/components/ui/chat-widget"; /** * ChatWidgetAppearancePanel — WealthX DS (Organism) * * Brand-color settings for the embeddable website chat widget, beside a live * preview of the widget itself. * * The preview mirrors production rather than faking it: it is wrapped in a * nested ThemeProvider carrying the tenant color, and `brandColor` is passed * only in `"custom"` mode. So `"theme"` mode previews the same way it ships — * as the *absence* of an override, inheriting the tenant color. * * Pure display component. Persistence is owned by the app layer. */ export interface ChatWidgetAppearancePanelProps { mode: BrandColorMode; onModeChange: (mode: BrandColorMode) => void; /** Tenant brand color from company settings. */ themeColor: string; customColor: string; onCustomColorChange: (color: string) => void; /** Broker name shown in the preview widget header. */ brokerName?: string; title?: string; disabled?: boolean; className?: string; } export function ChatWidgetAppearancePanel({ mode, onModeChange, themeColor, customColor, onCustomColorChange, brokerName = "Your Broker", title = "Widget Appearance", disabled, className, }: ChatWidgetAppearancePanelProps) { return (
{title}
Live preview