import { jsx } from "react/jsx-runtime";
import { Button, CircularProgress } from "@mui/material";
import { primaryContrastColor } from "../../utils/format.js";
export default function SubmitButton({
  canSubmit,
  isProcessing,
  isWaitingStripe,
  label,
  processingLabel,
  onSubmit
}) {
  return /* @__PURE__ */ jsx(
    Button,
    {
      variant: "contained",
      size: "large",
      fullWidth: true,
      disabled: !canSubmit || isWaitingStripe,
      onClick: onSubmit,
      startIcon: isProcessing ? /* @__PURE__ */ jsx(CircularProgress, { size: 20, color: "inherit" }) : null,
      sx: {
        py: 1.5,
        fontSize: "1.3rem",
        fontWeight: 600,
        textTransform: "none",
        color: (theme) => primaryContrastColor(theme)
      },
      children: isProcessing ? processingLabel : label
    }
  );
}
