import Button from "@mui/material/Button";
import Dialog from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";

export function ConfirmDialog({ confirmColor = "primary", content, loading, onClose, onConfirm, open, title }) {
  return (
    <Dialog fullWidth maxWidth="xs" open={open} onClose={loading ? undefined : onClose}>
      <DialogTitle>{title}</DialogTitle>
      <DialogContent><DialogContentText>{content}</DialogContentText></DialogContent>
      <DialogActions><Button disabled={loading} onClick={onClose}>取消</Button><Button color={confirmColor} disabled={loading} onClick={onConfirm} variant="contained">确认</Button></DialogActions>
    </Dialog>
  );
}
