change packages & change data in weekly day & add fields to modal add & remove validation from login page
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
||||
import { request } from "@/services/response";
|
||||
import { Button } from "@mui/material";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
function SendAppo({ hour }) {
|
||||
const params = useParams();
|
||||
const doctorId = params.doctorId;
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const sendReq = () => {
|
||||
setLoading(true);
|
||||
request
|
||||
.postAppointment({
|
||||
doctor_id: doctorId,
|
||||
slot: hour,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
// if (locateVisit) {
|
||||
// setStep((prev) => prev + 1);
|
||||
// } else {
|
||||
// setIsError(true);
|
||||
// }
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full flex justify-end">
|
||||
<Button
|
||||
className="!gap-[4px] !text-[16px] !font-medium !shadow-none !px-[12px] !py-[8px] md:!py-[9px] !w-full md:!w-fit !min-w-[157px]"
|
||||
variant="contained"
|
||||
loading={loading}
|
||||
onClick={sendReq}
|
||||
disabled={!hour}
|
||||
>
|
||||
تایید نوبت
|
||||
<ArrowLeftB />
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SendAppo;
|
||||
Reference in New Issue
Block a user