components/appointment/ had every colour hard-coded, so the flow rendered identically in either theme even after the wiring was fixed. It now reads from CSS custom properties. These are not new colours. The :root values are byte-for-byte the hex codes that were already in the components — twenty-one files, mapped one to one — so light mode is unchanged. The dark values are derived from those same colours: surfaces and borders darkened, text inverted, and the two brand colours (the indigo and the orange) lightened rather than replaced, because both lose contrast against a dark surface at their original values. Verified in a headless browser with prefers-color-scheme forced dark: data-theme lands on <html> and --ap-surface resolves to #1b1b20 rather than white. Six one-off colours remain hard-coded — a success green, an error red and similar — each used exactly once and none of them a surface. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
126 lines
5.5 KiB
JavaScript
126 lines
5.5 KiB
JavaScript
"use client";
|
|
|
|
import ArrowLeftOrangeA from "@/components/icons/ArrowLeftOrangeA";
|
|
import CalendarA from "@/components/icons/CalendarA";
|
|
import ClockA from "@/components/icons/ClockA";
|
|
import LocationA from "@/components/icons/LocationA";
|
|
import TickCircleOrange from "@/components/icons/TickCircleOrange";
|
|
import { Button } from "@mui/material";
|
|
import moment from "moment-jalaali";
|
|
|
|
function Detail({ doctor, step, setStep, selectedSlot, selectedDate }) {
|
|
const matchedAddress = selectedSlot?.location_id
|
|
? doctor?.address?.find((a) => String(a.id) === String(selectedSlot.location_id))?.address
|
|
: doctor?.address?.[0]?.address;
|
|
const address = matchedAddress || "آدرس موجود نیست";
|
|
|
|
// فرمت کردن تاریخ به شمسی
|
|
const formattedDate = selectedDate
|
|
? moment.unix(selectedDate).utcOffset(210).locale('fa').format('jDD jMMMM jYYYY')
|
|
: "تاریخ انتخاب نشده";
|
|
|
|
// فرمت کردن زمان
|
|
const formattedTime = selectedSlot?.start_time || "زمان انتخاب نشده";
|
|
|
|
return (
|
|
<div className="">
|
|
<ul className="flex flex-col items-start justify-start gap-[24px]">
|
|
<li className="flex items-center justify-start gap-[4px]">
|
|
<div className="w-[18px] h-[18px] md:w-[20px] md:h-[20px]">
|
|
<LocationA />
|
|
</div>
|
|
<p className="text-[var(--ap-text-2)] text-[14px] md:text-[16px] font-normal">
|
|
آدرس: {address}
|
|
</p>
|
|
</li>
|
|
<li className="flex items-center justify-between w-full">
|
|
<div className="flex items-center justify-start gap-[4px]">
|
|
<div className="w-[18px] h-[18px] md:w-[20px] md:h-[20px]">
|
|
<CalendarA />
|
|
</div>
|
|
<div className="flex items-center justify-start">
|
|
<p className="text-[var(--ap-text-2)] text-[14px] md:text-[16px] font-medium">
|
|
تاریخ نوبت:{" "}
|
|
</p>
|
|
<p className="text-[var(--ap-heading)] text-[14px] md:text-[16px] font-medium mr-1">
|
|
{formattedDate}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{step < 5 && (
|
|
<Button
|
|
className="!p-1 !flex !items-center !justify-end !gap-[2px]"
|
|
onClick={() => setStep(0)}
|
|
variant="text"
|
|
>
|
|
<p className="!text-[var(--ap-accent)] !text-[12px] md:!text-[14px] !font-normal">
|
|
تغییر{" "}
|
|
</p>
|
|
<div className="w-[16px] h-[16px] sm:w-[18px] sm:h-[18px] md:w-[21px] md:h-[21px] lg:w-[24px] lg:h-[24px]">
|
|
<ArrowLeftOrangeA />
|
|
</div>
|
|
</Button>
|
|
)}
|
|
</li>
|
|
<li className="flex items-center justify-between w-full">
|
|
<div className="flex items-center justify-start gap-[4px]">
|
|
<div className="w-[18px] h-[18px] md:w-[20px] md:h-[20px]">
|
|
<ClockA />
|
|
</div>
|
|
<div className="flex items-center justify-start">
|
|
<p className="text-[var(--ap-text-2)] text-[14px] md:text-[16px] font-medium">
|
|
زمان نوبت:{" "}
|
|
</p>
|
|
<p className="text-[var(--ap-heading)] text-[14px] md:text-[16px] font-medium mr-1">
|
|
ساعت {formattedTime}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{step < 5 && (
|
|
<Button
|
|
className="!p-1 !flex !items-center !justify-end !gap-[2px]"
|
|
onClick={() => setStep(0)}
|
|
variant="text"
|
|
>
|
|
<p className="!text-[var(--ap-accent)] !text-[12px] md:!text-[14px] !font-normal">
|
|
تغییر{" "}
|
|
</p>
|
|
<div className="w-[16px] h-[16px] sm:w-[18px] sm:h-[18px] md:w-[21px] md:h-[21px] lg:w-[24px] lg:h-[24px]">
|
|
<ArrowLeftOrangeA />
|
|
</div>
|
|
</Button>
|
|
)}
|
|
</li>
|
|
</ul>
|
|
<span
|
|
className="mt-[10px] sm:mt-[16px] md:mt-[22px] lg:mt-[28px] mb-[8px] sm:mb-[13px] md:mb-[19px] lg:mb-[24px] w-full h-px bg-[var(--ap-border-2)] block"
|
|
></span>
|
|
<ul className="flex flex-col items-start justify-start gap-[8px] sm:gap-[13px] md:gap-[19px] lg:gap-[24px]">
|
|
{/* <li className="flex items-center justify-start gap-[4px] md:gap-[6px] lg:gap-[8px]">
|
|
<div
|
|
className="min-w-[16px] sm:min-w-[19px] md:min-w-[21px] lg:min-w-[24px] min-h-[16px] sm:min-h-[19px] md:min-h-[21px] lg:min-h-[24px] w-[16px] sm:w-[19px] md:w-[21px] lg:w-[24px] h-[16px] sm:h-[19px] md:h-[21px] lg:h-[24px]"
|
|
>
|
|
<TickCircleOrange />
|
|
</div>
|
|
<p className="text-[var(--ap-text-2)] text-[12px] md:text-[14px] lg:text-[16px] font-normal">
|
|
فقط در صورت لغو نوبت تا 5 ساعت قبل از زمان ویزیت، امکان استرداد وجه
|
|
ممکن می باشد.
|
|
</p>
|
|
</li> */}
|
|
<li className="flex items-center justify-start gap-[4px] md:gap-[6px] lg:gap-[8px]">
|
|
<div
|
|
className="min-w-[16px] sm:min-w-[19px] md:min-w-[21px] lg:min-w-[24px] min-h-[16px] sm:min-h-[19px] md:min-h-[21px] lg:min-h-[24px] w-[16px] sm:w-[19px] md:w-[21px] lg:w-[24px] h-[16px] sm:h-[19px] md:h-[21px] lg:h-[24px]"
|
|
>
|
|
<TickCircleOrange />
|
|
</div>
|
|
<p className="text-[var(--ap-text-2)] text-[12px] md:text-[14px] lg:text-[16px] font-normal">
|
|
لطفا به موقع در مطب حضور داشته باشید.
|
|
</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Detail;
|