refactor(dateTime): streamline slot handling and improve session management

This commit is contained in:
hamed
2026-07-15 19:16:24 +03:30
parent 07d6526f74
commit d5845bf84d
4 changed files with 55 additions and 51 deletions
+3 -4
View File
@@ -1,8 +1,8 @@
import { Button } from "@mui/material";
import React from "react";
function List({ appo, hour, setHour, value }) {
const list = appo && appo[value ? "evening" : "morning"];
function List({ slots, hour, setHour }) {
const list = slots;
const checkHour = (item) => JSON.stringify(item) === JSON.stringify(hour);
const isSelectable = (item) =>
item.is_available && !(item?.start && item.start * 1000 < Date.now());
@@ -30,8 +30,7 @@ function List({ appo, hour, setHour, value }) {
} else {
return (
<p className="text-[#525252] text-[14px] md:text-[16px] font-medium py-[56px]">
در حال حاضر، نوبتی برای ساعتهای {[value ? "بعد از ظهر" : "صبح"]} موجود
نمیباشد.
در حال حاضر، نوبتی برای این شیفت موجود نمیباشد.
</p>
);
}