import React from "react";
import "./ConfirmButton.css";

interface ConfirmButtonProps {
  text: string;
  onClick?: () => void;
  disabled?: boolean;
}

const ConfirmButton: React.FC<ConfirmButtonProps> = ({
  text,
  onClick,
  disabled = false,
}) => {
  const handleClick = () => {
    if (!disabled && onClick) {
      onClick();
    }
  };

  return (
    <div
      className={`confirm-button${disabled ? " confirm-button--disabled" : ""}`}
      onClick={handleClick}
      aria-disabled={disabled}
    >
      <span className="confirm-button-text">{text}</span>
    </div>
  );
};

export default ConfirmButton;
