import { Button } from "@/components/ui/button";
import React from "react";
import { ModButtonCancellationProps } from "./TButton";
import { CgSpinner } from "react-icons/cg";

class ModButtonCancellation extends React.Component<ModButtonCancellationProps> {
  constructor(props: ModButtonCancellationProps) {
    super(props);
  }
  render(): React.ReactNode {
    return (
      <Button
        disabled={this.props.isLoading}
        onClick={() => this.props.onClick()}
        style={{ backgroundColor: "red" }}
      >
        {this.props.isLoading ? (
          <CgSpinner size={20} className="mr-2 animate-spin" />
        ) : null}
        {this.props.isLoading
          ? this.props.isLoadingContent
          : this.props.content}
      </Button>
    );
  }
}

export { ModButtonCancellation };
