import React from "react";
import { ModModalCancellationProps, ModModalConfirmationProps } from "./TModal";
import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogOverlay,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";

class ModModalCancellation extends React.Component<ModModalCancellationProps> {
  constructor(props: ModModalCancellationProps) {
    super(props);
  }

  render(): React.ReactNode {
    return (
      <AlertDialog>
        <AlertDialogTrigger asChild>
          <Button>{this.props.triggerButton}</Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
          <AlertDialogHeader>
            <AlertDialogTitle>{this.props.heading}</AlertDialogTitle>
            <AlertDialogDescription>
              {this.props.content}
            </AlertDialogDescription>
          </AlertDialogHeader>
          <AlertDialogFooter>
            <AlertDialogCancel>
              {this.props.cancelButton.content}
            </AlertDialogCancel>
            <AlertDialogAction style={{ backgroundColor: "red" }}>
              {this.props.actionButton.content}
            </AlertDialogAction>
          </AlertDialogFooter>
        </AlertDialogContent>
      </AlertDialog>
    );
  }
}

export { ModModalCancellation };
