import { IconPlus, IconTrash } from "@tabler/icons-react"; import type { ContactChannel } from "@/lib/cinemas"; /** * แก้ช่องทางติดต่อของการ์ด "สอบถามข้อมูลและจองตั๋ว" ต่อโรง * แต่ละแถว = label / ค่าที่แสดง / ลิงก์ (ถ้าไม่มีลิงก์ หน้าเว็บแสดงเป็นข้อความธรรมดา) */ const SUGGESTED_LABELS = [ "Website", "Facebook", "Instagram", "Line", "Call", "อีเมล", "จองตั๋ว", ]; const smallButtonClass = "flex min-h-9 items-center gap-1 rounded-lg border border-[#303030] px-2 text-xs text-[#999] transition hover:border-[#A92626] hover:text-[#D47272]"; type Props = { contacts: ContactChannel[]; onChange: (next: ContactChannel[]) => void; inputClass: string; labelClass: string; }; export function ContactsEditor({ contacts, onChange, inputClass, labelClass }: Props) { function updateAt(index: number, patch: Partial) { onChange( contacts.map((item, i) => (i === index ? { ...item, ...patch } : item)), ); } return (
ช่องทางติดต่อ / จองตั๋ว {contacts.length === 0 ? ( ยังไม่มีช่องทางติดต่อ — หน้าเว็บจะขึ้น “ยังไม่ระบุช่องทางติดต่อ” ) : null} {contacts.map((contact, index) => (
))} {SUGGESTED_LABELS.map((label) => (
); }