fix(appointment): update display logic for inactive doctors and free turns
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user