fix(appointment): update display logic for inactive doctors and free turns

This commit is contained in:
hamed
2026-06-22 09:47:11 +03:30
parent 12d2e2e3f1
commit a83e352dd8
4 changed files with 215 additions and 18 deletions
+19 -7
View File
@@ -18,19 +18,31 @@ function AppointmentList({ doctor, loading, doctorSlug }) {
border-solid bottom-0 right-0 w-full p-4 flex items-center justify-between"
>
<p className="text-[#05BA58] text-[11px] font-normal">
{doctor && doctor?.free_turn}
{doctor?.active === false || !doctor?.free_turn
? "نوبت‌دهی غیرفعال است"
: `اولین نوبت آزاد: ${doctor.free_turn}`}
</p>
<Link href={`/appointment/${doctorSlug}`}>
{doctor?.active === false ? (
<Button
variant="contained"
className="!py-2 !px-4 gap-1 !text-[14px] !font-medium"
disabled
>
دریافت نوبت
<div className="w-[20px] h-[20px]">
<ArrowLeftD />
</div>
نوبتدهی غیرفعال
</Button>
</Link>
) : (
<Link href={`/appointment/${doctorSlug}`}>
<Button
variant="contained"
className="!py-2 !px-4 gap-1 !text-[14px] !font-medium"
>
دریافت نوبت
<div className="w-[20px] h-[20px]">
<ArrowLeftD />
</div>
</Button>
</Link>
)}
</div>
</>
);