import { IconPlus, IconTrash } from "@tabler/icons-react"; /** * แก้รายการรูปโรงหนัง (อาร์เรย์ `photos`) — ใส่เป็น URL หรือ path ในโปรเจกต์ * รูปแรกใช้เป็นภาพหลักของแกลเลอรี · ลากสลับลำดับไม่ได้ ใช้ปุ่ม ↑/↓ แทน */ type Props = { photos: string[]; onChange: (next: string[]) => void; inputClass: string; labelClass: string; }; 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]"; export function PhotosEditor({ photos, onChange, inputClass, labelClass }: Props) { function updateAt(index: number, value: string) { onChange(photos.map((item, i) => (i === index ? value : item))); } return (
รูปภาพโรงหนัง {photos.length === 0 ? ( ยังไม่มีรูป — หน้าเว็บจะแสดงช่องแทน (ภาพที่ 1/2/3) ) : null} {photos.map((photo, index) => (
{photo ? ( // eslint-disable-next-line jsx-a11y/alt-text ) : null}
))}
); }