import { cn } from "@suphark/ui/lib/utils"; import type { ReactNode } from "react"; /** * หน้าว่าง = คำเชิญให้ทำขั้นถัดไป: ไอคอน, ประโยคเดียวว่าคืออะไร, ปุ่มเดียวว่าทำอะไรต่อ * * - `variant`: "dashed" (ค่าเริ่มต้น กรอบเส้นประ) · "card" (พื้น card เส้นทึบ) · "plain" (ไม่มีกรอบ — วางใน card ที่มีอยู่แล้ว) * - `size="compact"`: ระยะ/ไอคอนเล็ก สำหรับช่องแคบ เช่น panel ข้าง, popover, ตารางย่อย * - `tone="destructive"`: ไอคอนสีแดง สำหรับสถานะว่างเพราะผิดพลาด (เช่น โหลดไม่ได้) — ข้อผิดพลาดทั้งหน้าใช้ ErrorState * - `secondaryAction`: ปุ่มรอง วางข้าง `action` */ export function EmptyState({ icon, title, description, action, secondaryAction, variant = "dashed", size = "default", tone = "default", className, }: { icon?: ReactNode; title: ReactNode; description?: ReactNode; action?: ReactNode; secondaryAction?: ReactNode; variant?: "dashed" | "card" | "plain"; size?: "default" | "compact"; /** `danger` = `destructive`, `neutral` = `default` (ให้ตรงกับ StatusBadge) */ tone?: "default" | "destructive" | "danger" | "neutral"; className?: string; }) { const compact = size === "compact"; return (
{title}
{description && ({description}
)} {(action || secondaryAction) && (