chore(publish): replace source tree with static export at repo root
Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.
Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
This commit is contained in:
1 parent
05487728a7
commit
e6c4ebff48
394 files changed
+3977
-37891
No files matched your search
@@ -1,105 +0,0 @@
|
||||
import type { Cinema } from "@/lib/cinemas";
|
||||
import { DEFAULT_LOCALE, MESSAGES, type FacilityKey } from "@/lib/i18n/messages";
|
||||
|
||||
/**
|
||||
* แก้ข้อความสิ่งอำนวยความสะดวก "ของโรงนี้" (ผูกกับโรง ไม่ใช่ส่วนกลาง)
|
||||
*
|
||||
* - ชื่อหัวข้อ: ช่องเดียว (ใช้ทั้ง TH/EN) — ว่าง = ใช้ค่าเริ่มต้นจาก messages.ts
|
||||
* - คำอธิบาย TH/EN: แสดงเฉพาะโรงที่ต้องการ (hasDescriptions) เช่น เฮ้าส์ สามย่าน
|
||||
* ที่มีข้อมูลครบแล้ว โรงอื่นไม่ต้องกรอก
|
||||
*/
|
||||
|
||||
export type FacilityDetail = {
|
||||
label?: string;
|
||||
sub_th?: string;
|
||||
sub_en?: string;
|
||||
};
|
||||
|
||||
const ADMIN_MESSAGES = MESSAGES[DEFAULT_LOCALE];
|
||||
|
||||
type Props = {
|
||||
facilities: FacilityKey[];
|
||||
details: NonNullable<Cinema["facility_details"]>;
|
||||
hasDescriptions: boolean;
|
||||
onChange: (next: NonNullable<Cinema["facility_details"]>) => void;
|
||||
inputClass: string;
|
||||
labelClass: string;
|
||||
};
|
||||
|
||||
export function CinemaFacilitiesEditor({
|
||||
facilities,
|
||||
details,
|
||||
hasDescriptions,
|
||||
onChange,
|
||||
inputClass,
|
||||
labelClass,
|
||||
}: Props) {
|
||||
if (facilities.length === 0) {
|
||||
return (
|
||||
<span className="text-[11px] text-[#777]">
|
||||
เลือกหัวข้อด้านบนก่อน แล้วค่อยใส่ชื่อที่ต้องการ
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function update(key: FacilityKey, patch: FacilityDetail) {
|
||||
const current = details[key] ?? {};
|
||||
const next: FacilityDetail = { ...current, ...patch };
|
||||
const cleaned: FacilityDetail = {};
|
||||
if (next.label?.trim()) cleaned.label = next.label;
|
||||
if (next.sub_th?.trim()) cleaned.sub_th = next.sub_th;
|
||||
if (next.sub_en?.trim()) cleaned.sub_en = next.sub_en;
|
||||
onChange({ ...details, [key]: cleaned });
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
{facilities.map((key) => {
|
||||
const fallback = ADMIN_MESSAGES.facilities[key];
|
||||
const detail = details[key] ?? {};
|
||||
return (
|
||||
<div
|
||||
key={key}
|
||||
className="grid gap-2 rounded-lg border border-[#242424] p-2 sm:grid-cols-2"
|
||||
>
|
||||
<label className={labelClass}>
|
||||
ชื่อหัวข้อ
|
||||
<input
|
||||
className={inputClass}
|
||||
value={detail.label ?? ""}
|
||||
placeholder={fallback.title}
|
||||
onChange={(event) => update(key, { label: event.target.value })}
|
||||
/>
|
||||
</label>
|
||||
{hasDescriptions ? (
|
||||
<>
|
||||
<label className={labelClass}>
|
||||
คำอธิบาย (TH)
|
||||
<input
|
||||
className={inputClass}
|
||||
value={detail.sub_th ?? ""}
|
||||
placeholder={fallback.sub}
|
||||
onChange={(event) =>
|
||||
update(key, { sub_th: event.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className={labelClass}>
|
||||
คำอธิบาย (EN)
|
||||
<input
|
||||
className={inputClass}
|
||||
value={detail.sub_en ?? ""}
|
||||
placeholder={MESSAGES.en.facilities[key].sub}
|
||||
onChange={(event) =>
|
||||
update(key, { sub_en: event.target.value })
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user