-
-
{s.station_name_th}
-
จุดต้นทาง
+
+
+
+ {s.stop_sequence}
+
+
+
+ {stopHref ? (
+ {s.name_th}
+ ) : (
+ {s.name_th}
+ )}
+ {isStart && ต้นทาง}
+ {isEnd && ปลายทาง}
-
-
{s.direction_note || "ทุกทิศทาง"}
- {s.schedule_note &&
{s.schedule_note}}
+
+ {s.station_type}
+ {(s.city_th || s.province_th) && (
+
+ {[s.city_th, s.province_th].filter(Boolean).join(" · ")}
+
+ )}
+ {!hasCoord && ไม่มีพิกัดบนแผนที่}
- {s.departure_times.length === 0 ? (
-
— ยังไม่มีรอบ —
+ {stopHref ? (
+
→
) : (
-
- {s.departure_times.map((t, j) => (
- {t}
- ))}
-
+
→
)}
-
+
);
})}
-
- )}
-
+
+
+
+ {/* ตารางเวลา */}
+
+ ตารางเวลา ({schedules.length})
+ {schedules.length === 0 ? (
+ ยังไม่มีข้อมูลตารางเวลา
+ ) : (
+
+ {schedules.map((s, i) => {
+ const tone = TONES[i % TONES.length];
+ return (
+
+
+
+
+ {s.station_name_th}
+ จุดต้นทาง
+
+
+ {s.direction_note || "ทุกทิศทาง"}
+ {s.schedule_note && {s.schedule_note}}
+
+
+ {s.departure_times.length === 0 ? (
+ — ยังไม่มีรอบ —
+ ) : (
+
+ {s.departure_times.map((t, j) => (
+ {t}
+ ))}
+
+ )}
+
+ );
+ })}
+
+ )}
+
+
);
}
diff --git a/frontend/src/app/stops/details/page.tsx b/frontend/src/app/stops/details/page.tsx
index 111c1e8..a526405 100644
--- a/frontend/src/app/stops/details/page.tsx
+++ b/frontend/src/app/stops/details/page.tsx
@@ -1,12 +1,26 @@
import Link from "next/link";
import { notFound } from "next/navigation";
-import { api, isApiNotFoundError, resolveFileUrl, type Schedule, type StopDetail } from "@/lib/api";
+import { api, isApiNotFoundError, type Schedule, type StopDetail } from "@/lib/api";
import LazyMapView from "@/components/LazyMapView";
+import { LiveClock } from "@/components/LiveClock";
import { VisitTracker } from "@/lib/visit-tracker";
import { stopPhoto } from "@/lib/images";
import { Icon } from "@/components/Icons";
-const TONES = ["sky", "purple", "pink", "mint", "amber"] as const;
+const TYPE_LABEL: Record
= {
+ main_terminal: "สถานีขนส่ง",
+ local_stop: "ป้ายหลัก",
+ market: "ตลาด/ชุมชน",
+ private_stop: "จุดรับส่ง",
+ other: "อื่น ๆ",
+};
+
+const GROUP_TONE: Record = {
+ bangkok: "sky",
+ interprovincial: "purple",
+ in_province: "pink",
+ municipal: "mint",
+};
type StopDetailsPageProps = {
searchParams: Promise<{ code?: string }>;
@@ -23,9 +37,7 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
stop = await api.stop(code);
({ items: schedules } = await api.schedules({ stop_code: stop.code }));
} catch (error) {
- if (isApiNotFoundError(error)) {
- notFound();
- }
+ if (isApiNotFoundError(error)) notFound();
stop = null;
schedules = [];
}
@@ -42,100 +54,145 @@ export default async function StopDetailsPage({ searchParams }: StopDetailsPageP
);
}
- const place = [stop.city_th, stop.province_th].filter(Boolean).join(" / ") || "—";
+
+ const place = [stop.city_th, stop.province_th].filter(Boolean).join(" · ") || "—";
const hasMap = stop.lat != null && stop.lng != null;
const mapPoints = hasMap
? [{ id: stop.id, lat: stop.lat as number, lng: stop.lng as number, label: stop.name_th, code: stop.code }]
: [];
-
- // รูปป้ายจาก design (.image/stops/.jpg) — สำคัญกว่า backend images
const designPhoto = stopPhoto(stop.code);
+ const typeLabel = TYPE_LABEL[stop.station_type] ?? stop.station_type;
+ const routes = stop.routes ?? [];
+
+ // route_id -> เวลาออกทั้งหมดที่ป้ายนี้
+ const timesByRoute = new Map();
+ for (const s of schedules) {
+ const l = timesByRoute.get(s.route_id) ?? [];
+ l.push(...s.departure_times);
+ timesByRoute.set(s.route_id, l);
+ }
+ const allTimes = schedules.flatMap((s) => s.departure_times);
return (
-
- {stop.station_type}
- {stop.name_th}
- {place}{hasMap ? ` · ${stop.lat?.toFixed(4)}, ${stop.lng?.toFixed(4)}` : ""}
-
-
- {designPhoto ? (
-
-

+
+
+
+ หน้าแรก / ป้ายหยุดรถ /{" "}
+ {stop.name_th}
+
+
+
+
+
+
+
+ {stop.name_th}
+
+
+ {place}
+ {hasMap ? ` · ${stop.lat?.toFixed(4)}, ${stop.lng?.toFixed(4)}` : ""}
+
+
+ {typeLabel}
+ {stop.province_th && {stop.province_th}}
+ {hasMap && มีพิกัดบนแผนที่}
+
+
+
+
สายที่ผ่าน
+
{routes.length}
+
+
+
ประเภทป้าย
+
{typeLabel}
+
+
+
จังหวัด
+
{stop.province_th ?? "—"}
+
+
+
รอบเวลา
+
{allTimes.length}
+
+
- ) : stop.images.length > 0 ? (
-
-
![{(stop.images[0].meta]({resolveFileUrl(stop.images[0].url_path)})
- {stop.images.length > 1 && (
-
- {stop.images.slice(1, 5).map((img) => (
-
})
- ))}
+
+ {designPhoto ? (
+

+ ) : (
+
+ ยังไม่มีรูปป้ายนี้
)}
+
- ) : (
-
-
ยังไม่มีรูปป้ายนี้
+
+
+
+
+
สายรถที่ผ่านจุดนี้
+ {routes.length === 0 ? (
+
ยังไม่มีข้อมูลสายที่ผ่าน
+ ) : (
+
+ {routes.map((r) => {
+ const times = timesByRoute.get(r.route_id) ?? [];
+ const tone = GROUP_TONE[r.route_group_code] ?? "purple";
+ return (
+ -
+
+
+ {r.route_id}
+ {r.name_th}
+ {times.length} รอบ
+
+
+
+ ดูรายละเอียดสาย {r.route_id} →
+
+ {times.length === 0 ? (
+
ยังไม่มีรอบเวลา
+ ) : (
+
+ {times.map((t, j) => (
+ {t}
+ ))}
+
+ )}
+
+
+
+ );
+ })}
+
+ )}
- )}
- {hasMap ? (
-
-
-
- ) : (
-
-
ยังไม่มีพิกัดของป้ายนี้
-
- )}
-
-
ตารางเวลาที่จุดนี้
- {schedules.length === 0 ? (
-
ยังไม่มีข้อมูล
- ) : (
-
- {schedules.map((s, i) => {
- const tone = TONES[i % TONES.length];
- return (
-
-
-
-
-
เส้นทาง
-
{s.route_id}
-
-
-
-
- {s.direction_note || "ไม่ระบุทิศทาง"}
-
- {s.schedule_note && (
- {s.schedule_note}
- )}
-
-
-
- {s.departure_times.length === 0 ? (
- — ยังไม่มีรอบ —
- ) : (
- s.departure_times.map((t, j) => (
- {t}
- ))
- )}
-
-
- );
- })}
+
+
- )}
+
);
}
diff --git a/frontend/src/app/stops/page.tsx b/frontend/src/app/stops/page.tsx
index d11d741..4751bed 100644
--- a/frontend/src/app/stops/page.tsx
+++ b/frontend/src/app/stops/page.tsx
@@ -6,40 +6,55 @@ import { Icon, type IconName } from "@/components/Icons";
const TONES = ["sky", "purple", "pink", "mint", "amber"] as const;
const TYPE_TONE: Record
= {
- terminal: "purple",
- station: "sky",
- pickup: "amber",
+ main_terminal: "purple",
+ local_stop: "sky",
market: "pink",
- landmark: "mint",
+ private_stop: "amber",
+ other: "mint",
};
const TYPE_ICON: Record = {
- terminal: "bus-front",
- station: "map-pin",
- pickup: "bus",
+ main_terminal: "bus-front",
+ local_stop: "map-pin",
market: "store",
- landmark: "map-pin",
+ private_stop: "bus",
+ other: "map-pin",
};
const TYPE_LABEL: Record = {
- terminal: "สถานีขนส่ง",
- station: "ป้ายหลัก",
- pickup: "จุดรับส่ง",
+ main_terminal: "สถานีขนส่ง",
+ local_stop: "ป้ายหลัก",
market: "ตลาด/ชุมชน",
- landmark: "จุดสังเกต",
+ private_stop: "จุดรับส่ง",
+ other: "อื่น ๆ",
};
-export default async function StopsPage() {
- const { items } = await api.stops().catch(() => ({ items: [] }));
+export default async function StopsPage({
+ searchParams,
+}: {
+ searchParams: Promise<{ q?: string }>;
+}) {
+ const sp = await searchParams;
+ const q = sp.q ?? "";
+ const { items } = await api.stops(q ? { q } : {}).catch(() => ({ items: [] }));
+
const points = items
.filter((s) => s.lat != null && s.lng != null)
.map((s) => ({ id: s.id, lat: s.lat as number, lng: s.lng as number, label: s.name_th, code: s.code }));
+
const typeCounts = items.reduce>((acc, s) => {
acc[s.station_type] = (acc[s.station_type] ?? 0) + 1;
return acc;
}, {});
+
return (
+
+
+ หน้าแรก / ป้ายหยุดรถ
+
+
+
@@ -60,80 +75,73 @@ export default async function StopsPage() {
- {points.length > 0 && (
-
-
-
- )}
+
+ {points.length > 0 && !q && (
+
+
+
+ )}
-
-
-
-
+
+
+
+ {Object.entries(typeCounts).map(([t, n]) => (
+
+ {TYPE_LABEL[t] ?? t} · {n}
+
+ ))}
+
-
- {Object.entries(typeCounts).map(([t, n]) => (
-
- {TYPE_LABEL[t] ?? t} · {n}
-
- ))}
-
-
-
- {items.map((s, i) => {
- const tone = TYPE_TONE[s.station_type] ?? TONES[i % TONES.length];
- const icon = TYPE_ICON[s.station_type] ?? "map-pin";
- const place = [s.city_th, s.province_th].filter(Boolean).join(" · ");
- const stopHref = s.code ? `/stops/${encodeURIComponent(s.code)}` : null;
- return (
- stopHref ? (
-
-
-
-
-
-
{s.name_th}
-
{place || "—"}
-
-
- {TYPE_LABEL[s.station_type] ?? s.station_type}
-
- {s.lat != null && s.lng != null && (
-
บนแผนที่
- )}
+ {items.length === 0 ? (
+
ไม่พบป้ายที่ตรงกับ “{q}”
+ ) : (
+
+ {items.map((s, i) => {
+ const tone = TYPE_TONE[s.station_type] ?? TONES[i % TONES.length];
+ const icon = TYPE_ICON[s.station_type] ?? "map-pin";
+ const place = [s.city_th, s.province_th].filter(Boolean).join(" · ");
+ const stopHref = s.code ? `/stops/${encodeURIComponent(s.code)}` : null;
+ const body = (
+ <>
+
+
-
-
→
-
- ) : (
-
-
-
-
-
-
{s.name_th}
-
{place || "—"}
-
-
- {TYPE_LABEL[s.station_type] ?? s.station_type}
-
- {s.lat != null && s.lng != null && (
-
บนแผนที่
- )}
+
+
{s.name_th}
+
{place || "—"}
+
+
+ {TYPE_LABEL[s.station_type] ?? s.station_type}
+
+ {s.lat != null && s.lng != null && (
+ บนแผนที่
+ )}
+
+
→
+ >
+ );
+ return stopHref ? (
+
+ {body}
+
+ ) : (
+
+ {body}
-
→
-
- )
- );
- })}
+ );
+ })}
+
+ )}
);
}
-
diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx
index e97e888..c95f43a 100644
--- a/frontend/src/components/Header.tsx
+++ b/frontend/src/components/Header.tsx
@@ -99,7 +99,7 @@ export function Header() {
/
EN
-
{t("cta")}
+
{t("cta")}
diff --git a/frontend/src/components/LiveClock.tsx b/frontend/src/components/LiveClock.tsx
new file mode 100644
index 0000000..16dcf7f
--- /dev/null
+++ b/frontend/src/components/LiveClock.tsx
@@ -0,0 +1,41 @@
+"use client";
+
+import { useEffect, useState } from "react";
+
+/** นาฬิกาสด ณ ป้าย + คำนวณเที่ยวถัดไปอัตโนมัติ (จาก design: live-clock-card) */
+export function LiveClock({ times }: { times: string[] }) {
+ const [now, setNow] = useState("--:--");
+ const [next, setNext] = useState
(null);
+
+ useEffect(() => {
+ const tick = () => {
+ const d = new Date();
+ setNow(`${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`);
+ const cur = d.getHours() * 60 + d.getMinutes();
+ const n =
+ [...times]
+ .sort()
+ .find((t) => {
+ const [h, m] = t.split(":").map(Number);
+ return h * 60 + m >= cur;
+ }) ?? null;
+ setNext(n);
+ };
+ tick();
+ const id = setInterval(tick, 30_000);
+ return () => clearInterval(id);
+ }, [times]);
+
+ return (
+
+
+
เวลาปัจจุบัน ณ ป้ายนี้
+
{now}
+
+
+
+ {next ? `เที่ยวถัดไป ${next}` : "กำลังคำนวณเที่ยวถัดไปอัตโนมัติ"}
+
+
+ );
+}
diff --git a/frontend/src/components/RouteSelect.tsx b/frontend/src/components/RouteSelect.tsx
new file mode 100644
index 0000000..823b09f
--- /dev/null
+++ b/frontend/src/components/RouteSelect.tsx
@@ -0,0 +1,41 @@
+"use client";
+
+import { useRouter } from "next/navigation";
+import { Icon } from "@/components/Icons";
+
+type Props = {
+ routes: { route_id: string; name_th: string }[];
+ current: string;
+ /** คืน URL ปลายทางเมื่อเลือกสาย (default: /routes/:id) */
+ to?: (routeId: string) => string;
+};
+
+/** เลือกสายรถ — เปลี่ยนสายโดยไม่ต้องกลับหน้ารายการ (จาก design: route-select) */
+export function RouteSelect({ routes, current, to }: Props) {
+ const router = useRouter();
+ return (
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/data/captions-index.json b/frontend/src/data/captions-index.json
new file mode 100644
index 0000000..dfd900f
--- /dev/null
+++ b/frontend/src/data/captions-index.json
@@ -0,0 +1,86 @@
+{
+ "101": {
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "ประมาณ 30 ที่นั่ง · ให้บริการตลอดเส้นทางอ่างทอง–ป่าโมก–อยุธยา",
+ "line_note": "ติดตามข่าวสาย 101 · รถออกก่อนเวลาบ่อยครั้ง · รถขาดช่วง",
+ "qr": "/images/qrcode/101.png"
+ },
+ "1011": {
+ "vehicle_title": "รถเมล์ประจำเส้นทาง",
+ "vehicle_desc": "รถเมล์ ประมาณ 30 ที่นั่ง รถมีเที่ยว เช้า เที่บง เย็น",
+ "line_note": "",
+ "qr": ""
+ },
+ "15": {
+ "vehicle_title": "รถมินิบัส 20 ที่นั่ง",
+ "vehicle_desc": "ปัจจุบันส่วนใหญ่วิ่งแค่ป่าโมก หมอชิตใหม่ เหลือแค่รถ เบอร์ 20 ที่กลับถึงอ่างทอง บขส.อ่างทองมีรถออกแค่เช้ามืดถึงโมงเช้า",
+ "line_note": "",
+ "qr": "/images/qrcode/15.JPG"
+ },
+ "2194": {
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "รถสองแถวเช้ามืดและเย็น ผ่านอ่างทองแค่สามแยกข้ามสะพานโผงเผงและวัดถนน",
+ "line_note": "",
+ "qr": ""
+ },
+ "2231": {
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "มีเที่ยวเดียว เช้า-เย็น",
+ "line_note": "",
+ "qr": ""
+ },
+ "324": {
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "รถมีเที่ยว เช้า อย่างเดียว วิ่งสุดสายแค่วัดไชโย",
+ "line_note": "",
+ "qr": ""
+ },
+ "464": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": "/images/qrcode/464.jpeg"
+ },
+ "641": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": ""
+ },
+ "8": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": ""
+ },
+ "902": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": "/images/qrcode/902.png"
+ },
+ "951": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": ""
+ },
+ "952": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": ""
+ },
+ "954": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": ""
+ },
+ "999": {
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": "",
+ "qr": ""
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/data/captions/caption101.json b/frontend/src/data/captions/caption101.json
new file mode 100644
index 0000000..c535e2f
--- /dev/null
+++ b/frontend/src/data/captions/caption101.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "101",
+ "vehicle_image": "car.jpeg",
+ "qr_image": "101.png",
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "ประมาณ 30 ที่นั่ง · ให้บริการตลอดเส้นทางอ่างทอง–ป่าโมก–อยุธยา",
+ "line_note": "ติดตามข่าวสาย 101 · รถออกก่อนเวลาบ่อยครั้ง · รถขาดช่วง"
+}
diff --git a/frontend/src/data/captions/caption1011.json b/frontend/src/data/captions/caption1011.json
new file mode 100644
index 0000000..0f2b6f6
--- /dev/null
+++ b/frontend/src/data/captions/caption1011.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "1011",
+ "vehicle_image": "car.jpeg",
+ "qr_image": "",
+ "vehicle_title": "รถเมล์ประจำเส้นทาง",
+ "vehicle_desc": "รถเมล์ ประมาณ 30 ที่นั่ง รถมีเที่ยว เช้า เที่บง เย็น",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption15.json b/frontend/src/data/captions/caption15.json
new file mode 100644
index 0000000..30a21d6
--- /dev/null
+++ b/frontend/src/data/captions/caption15.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "15",
+ "vehicle_image": "car.jpg",
+ "qr_image": "15.JPG",
+ "vehicle_title": "รถมินิบัส 20 ที่นั่ง",
+ "vehicle_desc": "ปัจจุบันส่วนใหญ่วิ่งแค่ป่าโมก หมอชิตใหม่ เหลือแค่รถ เบอร์ 20 ที่กลับถึงอ่างทอง บขส.อ่างทองมีรถออกแค่เช้ามืดถึงโมงเช้า",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption2194.json b/frontend/src/data/captions/caption2194.json
new file mode 100644
index 0000000..701d114
--- /dev/null
+++ b/frontend/src/data/captions/caption2194.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "2194",
+ "vehicle_image": "car.jpg",
+ "qr_image": "",
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "รถสองแถวเช้ามืดและเย็น ผ่านอ่างทองแค่สามแยกข้ามสะพานโผงเผงและวัดถนน",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption2231.json b/frontend/src/data/captions/caption2231.json
new file mode 100644
index 0000000..969188f
--- /dev/null
+++ b/frontend/src/data/captions/caption2231.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "2231",
+ "vehicle_image": "car.jpg",
+ "qr_image": "",
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "มีเที่ยวเดียว เช้า-เย็น",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption324.json b/frontend/src/data/captions/caption324.json
new file mode 100644
index 0000000..1002afd
--- /dev/null
+++ b/frontend/src/data/captions/caption324.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "324",
+ "vehicle_image": "car.jpg",
+ "qr_image": "",
+ "vehicle_title": "รถสองแถวประจำเส้นทาง",
+ "vehicle_desc": "รถมีเที่ยว เช้า อย่างเดียว วิ่งสุดสายแค่วัดไชโย",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption464.json b/frontend/src/data/captions/caption464.json
new file mode 100644
index 0000000..0766219
--- /dev/null
+++ b/frontend/src/data/captions/caption464.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "464",
+ "vehicle_image": "car.jpeg",
+ "qr_image": "464.jpeg",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption641.json b/frontend/src/data/captions/caption641.json
new file mode 100644
index 0000000..f076c27
--- /dev/null
+++ b/frontend/src/data/captions/caption641.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "641",
+ "vehicle_image": "car.jpeg",
+ "qr_image": "",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption8.json b/frontend/src/data/captions/caption8.json
new file mode 100644
index 0000000..48a71ab
--- /dev/null
+++ b/frontend/src/data/captions/caption8.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "8",
+ "vehicle_image": "",
+ "qr_image": "",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption902.json b/frontend/src/data/captions/caption902.json
new file mode 100644
index 0000000..b638ada
--- /dev/null
+++ b/frontend/src/data/captions/caption902.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "902",
+ "vehicle_image": "car.jpg",
+ "qr_image": "902.png",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption951.json b/frontend/src/data/captions/caption951.json
new file mode 100644
index 0000000..c4ed125
--- /dev/null
+++ b/frontend/src/data/captions/caption951.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "951",
+ "vehicle_image": "car.jpg",
+ "qr_image": "",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption952.json b/frontend/src/data/captions/caption952.json
new file mode 100644
index 0000000..5b2f792
--- /dev/null
+++ b/frontend/src/data/captions/caption952.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "952",
+ "vehicle_image": "car.jpg",
+ "qr_image": "",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption954.json b/frontend/src/data/captions/caption954.json
new file mode 100644
index 0000000..9007c72
--- /dev/null
+++ b/frontend/src/data/captions/caption954.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "954",
+ "vehicle_image": "",
+ "qr_image": "",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/data/captions/caption999.json b/frontend/src/data/captions/caption999.json
new file mode 100644
index 0000000..790cd3d
--- /dev/null
+++ b/frontend/src/data/captions/caption999.json
@@ -0,0 +1,8 @@
+{
+ "route_id": "999",
+ "vehicle_image": "",
+ "qr_image": "",
+ "vehicle_title": "",
+ "vehicle_desc": "",
+ "line_note": ""
+}
diff --git a/frontend/src/lib/captions.ts b/frontend/src/lib/captions.ts
new file mode 100644
index 0000000..833ea9d
--- /dev/null
+++ b/frontend/src/lib/captions.ts
@@ -0,0 +1,15 @@
+import captions from "@/data/captions-index.json";
+
+export type RouteCaption = {
+ vehicle_title: string;
+ vehicle_desc: string;
+ line_note: string;
+ qr: string; // e.g. "/images/qrcode/101.png" ("" ถ้าไม่มี)
+};
+
+/** caption รถ/QR จาก design (resource/data/captions + .image/qrcode) */
+export function captionFor(routeId: string): RouteCaption | undefined {
+ const c = (captions as Record)[String(routeId)];
+ if (!c) return undefined;
+ return c.vehicle_title || c.vehicle_desc || c.line_note || c.qr ? c : undefined;
+}