Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.
Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.
Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.
Expected source tree: 0a4a7528e9.
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
// Modified in this independent fork for support availability; see docs/hardening/README.md.
|
|
"use client"
|
|
|
|
import { Badge } from "@/components/ui/badge"
|
|
import { cn } from "@/lib/utils"
|
|
import { useI18n } from "@/i18n/provider"
|
|
|
|
type SupportChatConnectionStatusProps = {
|
|
status: "connecting" | "connected" | "disconnected"
|
|
}
|
|
|
|
export function SupportChatConnectionStatus({ status }: SupportChatConnectionStatusProps) {
|
|
const t = useI18n()
|
|
const toneClass =
|
|
status === "connected"
|
|
? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/70 dark:bg-emerald-950/50 dark:text-emerald-300"
|
|
: status === "connecting"
|
|
? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/70 dark:bg-amber-950/50 dark:text-amber-300"
|
|
: "border-border bg-muted text-muted-foreground"
|
|
|
|
return (
|
|
<Badge
|
|
variant="outline"
|
|
className={cn("h-6 gap-2 px-2.5 text-[11px] font-medium", toneClass)}
|
|
>
|
|
<span
|
|
className={cn(
|
|
"inline-block size-2 rounded-full",
|
|
status === "connected"
|
|
? "bg-emerald-500"
|
|
: status === "connecting"
|
|
? "bg-amber-500"
|
|
: "bg-muted-foreground"
|
|
)}
|
|
/>
|
|
<span>{t(`supportChat.${status}`)}</span>
|
|
</Badge>
|
|
)
|
|
}
|