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

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

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

export { ModModalConfirmation };
