feat(appointment): implement service-based booking flow with service selection and slot adaptation

This commit is contained in:
hamed
2026-07-15 23:48:40 +03:30
parent d5845bf84d
commit 165a0a2240
11 changed files with 337 additions and 33 deletions
+28 -7
View File
@@ -1,4 +1,5 @@
import Date from "./date";
import ServiceSelect from "./service";
// Components
import Content from "./Content";
@@ -38,15 +39,34 @@ function Container({
setAppointmentId,
appointmentExpiresAt,
setAppointmentExpiresAt,
// Service-based booking
bookingMode,
bookingServices,
selectedServiceUuids,
setSelectedServiceUuids,
}) {
const serviceMode = bookingMode === "service";
const dateStep =
serviceMode && selectedServiceUuids.length === 0 ? (
<ServiceSelect
services={bookingServices}
onContinue={(uuids) => setSelectedServiceUuids(uuids)}
/>
) : (
<Date
doctor={doctor}
setStep={setStep}
disabledDates={disabledDates}
setSelectedSlot={setSelectedSlot}
setSelectedDate={setSelectedDate}
serviceMode={serviceMode}
selectedServiceUuids={selectedServiceUuids}
onChangeService={() => setSelectedServiceUuids([])}
/>
);
const elements = [
<Date
doctor={doctor}
setStep={setStep}
disabledDates={disabledDates}
setSelectedSlot={setSelectedSlot}
setSelectedDate={setSelectedDate}
/>,
dateStep,
<LogInPage
num={num}
setNum={setNum}
@@ -76,6 +96,7 @@ function Container({
selectedDate={selectedDate}
setAppointmentId={setAppointmentId}
setAppointmentExpiresAt={setAppointmentExpiresAt}
selectedServiceUuids={selectedServiceUuids}
/>,
<Paying
setStep={setStep}