"use client"; import { AvatarBadge } from "@suphark/ui/components/ui/avatar"; import { cn } from "@suphark/ui/lib/utils"; import { useUiText } from "./ui-text"; export type Presence = "online" | "away" | "busy" | "offline"; const PRESENCE_CLASS: Record = { online: "bg-success", away: "bg-warning", busy: "bg-destructive", offline: "bg-muted-foreground", }; const PRESENCE_TH: Record = { online: "ออนไลน์", away: "ไม่อยู่", busy: "ไม่ว่าง", offline: "ออฟไลน์", }; /** จุดสถานะมุมล่างขวาของ Avatar (ใช้ใน `Initials status`) — ชื่อสถานะอ่านได้ด้วย screen reader */ export function PresenceDot({ status, className }: { status: Presence; className?: string }) { const label = useUiText().presence?.[status] ?? PRESENCE_TH[status]; return ( {label} ); }