Files
nobat724_front/components/doctors/modal/ButtonApply.js
T
hamedandClaude Opus 4.8 f3192945c7 fix(doctors): resolve next/image http host and MUI v5 loading prop
- افزودن الگوی http برای api.clinic-pro.ir به next.config (عکس‌های بیمه
  با http برمی‌گردند و خطای 500 next/image می‌دادند)
- جایگزینی prop loading نامعتبر روی Button با disabled در SendReq/ButtonApply
  (loading فقط در MUI v6+ پشتیبانی می‌شود؛ این پروژه v5 است و lab نصب نیست)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 00:15:10 +03:30

31 lines
633 B
JavaScript

import { Button } from "@mui/material";
import { useState } from "react";
function ButtonApply({ sendReq, setOpen }) {
const [loading, setLoading] = useState(false);
const handleClick = () => {
setLoading(true);
sendReq().finally(() => {
setOpen(false);
setLoading(false);
});
};
return (
<div className="flex justify-end w-full">
<Button
disabled={loading}
variant="contained"
onClick={handleClick}
className="!px-3 !py-2 !text-[16px] !font-medium"
>
اعمال تغییرات
</Button>
</div>
);
}
export default ButtonApply;