"use client"; import moment from "moment-jalaali"; function nextAvailableLabel(timestamp) { if (!timestamp) return null; return `اولین نوبت آزاد: ${moment.unix(timestamp).format("jD jMMMM")}`; } /** * انتخاب محل نوبت‌دهی — پیش از انتخاب سرویس و روز. * * فهرست از سمت سرور بر اساس زودترین نوبت آزاد مرتب شده، پس اولین آیتم پیش‌فرض * درست است و اینجا دوباره مرتب نمی‌شود. */ function LocationSelect({ locations = [], selected, onSelect }) { return (

۱. انتخاب محل نوبت‌دهی

{locations.map((location) => { const key = location.clinic_uuid ?? location.location_uuid ?? "personal"; const active = (selected?.clinic_uuid ?? null) === (location.clinic_uuid ?? null); const nextLabel = nextAvailableLabel(location.next_available_at); return ( ); })}
); } export default LocationSelect;