import { cn } from "@suphark/ui/lib/utils"; import type { ComponentProps } from "react"; const TONE = { default: "text-foreground", primary: "text-primary", muted: "text-muted-foreground hover:text-foreground", } as const; export interface TextButtonProps extends ComponentProps<"button"> { /** สีตัวอักษร: `default` (สีข้อความปกติ), `primary` (แบบลิงก์), `muted` (จางจนชี้) */ tone?: keyof typeof TONE; /** เส้นใต้: `hover` (ค่าเริ่มต้น), `always`, `none` */ underline?: "hover" | "always" | "none"; } /** * ปุ่มที่เป็นข้อความล้วนในบรรทัด — ไม่มีกรอบ/พื้น/padding (ชื่อไฟล์ในแถวที่กดเปิด, "ดูทั้งหมด" ในประโยค) * `Button` ทุก variant มีความสูงและ padding ซึ่งดันแถว/ประโยคให้เพี้ยน · ยังมีวงโฟกัสคีย์บอร์ดและ disabled ตามมาตรฐาน * งานที่เป็นปุ่มจริง (บันทึก, ลบ, ไอคอน) ใช้ `Button` · ไปหน้าอื่นใช้ลิงก์ (``/`Link`) ไม่ใช่ตัวนี้ * * open(file)} className="truncate">{file.name} */ export function TextButton({ tone = "default", underline = "hover", type = "button", className, ...props }: TextButtonProps) { return (