feat(ui): port route/stop/check pages to match mock + tidy layout
Route detail: - breadcrumb + route-select dropdown (เปลี่ยนสายในหน้าเดียว) - vehicle card (รถ + caption + QR + ติดต่อโทร/LINE รวมการ์ดเดียว) - summary เพิ่ม 'รอบถัดไป' (คำนวณจาก schedules) - km list (จุดจอดตามเส้นทาง กม.) Stop detail: - stop-hero (title/meta pills/metric grid 4 + live clock เที่ยวถัดไป) - route expander (สายที่ผ่าน + เวลาต่อสาย) + map aside + chips - breadcrumb Stop list: - search form จริง (server-side ?q=) + breadcrumb - fix TYPE_LABEL/TONE/ICON ให้ตรง station_type จริง (main_terminal/local_stop/market/private_stop) Check page (ใหม่ /check): เช็กเวลาเดินรถ + selector + 4 สถิติ + ตารางทุกจุดจอด Header CTA -> /check Assets: caption<id>.json + qrcode/* จาก mock (lib/captions.ts)
This commit is contained in:
1 parent
b022a85178
commit
0c3936df69
24 files changed
+1084
-303
No files matched your search
@@ -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 (
|
||||
<div className="route-select-wrap">
|
||||
<label htmlFor="route-select" className="route-select-wrap__label">
|
||||
<Icon name="bus" size={14} className="icon" /> เลือกสายรถ
|
||||
</label>
|
||||
<div className="select-box select-box--toolbar">
|
||||
<Icon name="bus" size={18} className="select-box__icon" />
|
||||
<select
|
||||
id="route-select"
|
||||
value={current}
|
||||
onChange={(e) => {
|
||||
const v = e.target.value;
|
||||
router.push(to ? to(v) : `/routes/${encodeURIComponent(v)}`);
|
||||
}}
|
||||
>
|
||||
{routes.map((r) => (
|
||||
<option key={r.route_id} value={r.route_id}>
|
||||
{r.route_id} · {r.name_th}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<Icon name="arrow-right" size={18} className="select-box__chevron" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user