"use client"; import { Button } from "@suphark/ui/components/shared/button/button"; import { useUiText } from "@suphark/ui/components/shared/ui-text"; import { cn } from "@suphark/ui/lib/utils"; import { TriangleAlert } from "lucide-react"; import type React from "react"; /** * กล่องสถานะกลางตาราง (ไม่พบ / ว่าง / ผิดพลาด) — บนมือถือจำกัดความกว้างเท่าจอ * เพื่อไม่ให้ไปอยู่กลางตารางที่เลื่อนแนวนอน (sticky ที่ขอบซ้ายของกล่องเลื่อน) */ export function TableStateBox({ icon, title, hint, tone, children, }: { icon: React.ReactNode; title: string; hint?: string; tone?: "danger"; children?: React.ReactNode; }) { return (

{title}

{hint &&

{hint}

} {children && (
{children}
)}
); } /** โหลดไม่สำเร็จ: ข้อความกลาง ๆ (ไม่แสดงข้อความดิบของระบบ) + ปุ่มลองใหม่เมื่อส่ง `onRetry` */ export function TableErrorState({ onRetry }: { onRetry?: () => void }) { const text = useUiText(); return ( } title={text.table?.errorTitle ?? "โหลดรายการไม่สำเร็จ"} hint={text.table?.errorHint ?? "การเชื่อมต่อขัดข้อง ลองใหม่อีกครั้ง"} > {onRetry && ( )} ); } /** skeleton ของรายการมือถือ (แถวละ 3 บรรทัด) ระหว่างโหลด */ export function QuietMobileSkeleton({ rows }: { rows: number }) { const text = useUiText(); return ( ); }