import { IconBook, IconBriefcase, IconCoffee, IconPlant2, IconShoppingBag, IconSofa, IconTicket, IconToolsKitchen2, type Icon as TablerIcon, } from "@tabler/icons-react"; import { LocationPanel } from "@/components/cinema/LocationPanel"; import { cinemaFacilities, type Cinema } from "@/lib/cinemas"; import { useI18n } from "@/lib/i18n"; import type { FacilityKey } from "@/lib/i18n/messages"; import { COLORS } from "@/lib/design-tokens"; const FACILITY_ICONS: Record = { seating: IconSofa, ticket: IconTicket, restaurant: IconToolsKitchen2, cafe: IconCoffee, garden: IconPlant2, bookstore: IconBook, colearning: IconBriefcase, other: IconShoppingBag, }; /** สิ่งอำนวยความสะดวก (ซ้าย) + ที่ตั้ง (ขวา) ตาม layout ใน Figma */ export function FacilitiesSection({ cinema }: { cinema: Cinema }) { const { locale, messages } = useI18n(); const facilities = cinemaFacilities(cinema); return (

{messages.detail.facilities}

{facilities.length > 0 ? (
{facilities.map((key) => { const Icon = FACILITY_ICONS[key]; const base = messages.facilities[key]; const custom = cinema.facility_details?.[key]; const title = custom?.label?.trim() || base.title; // คำอธิบายแสดงเฉพาะที่กรอกไว้รายโรง (ค่าเริ่มต้นใช้เป็น placeholder ในหลังบ้าน) const sub = (locale === "en" ? custom?.sub_en : custom?.sub_th)?.trim() ?? ""; return (
{title}
{sub ? (
{sub}
) : null}
); })}
) : (

{messages.detail.noData}

)}
); }