"use client";

import Box from "@mui/material/Box";

import { AlertDialog } from "@/components/ui/alert-dialog";

type ProgressReportDeleteCommentDialogProps = {
  open: boolean;
  loading?: boolean;
  error?: string | null;
  onClose: () => void;
  onConfirm: () => void | Promise<void>;
};

export function ProgressReportDeleteCommentDialog({
  open,
  loading = false,
  error,
  onClose,
  onConfirm,
}: ProgressReportDeleteCommentDialogProps) {
  return (
    <AlertDialog
      open={open}
      title="Delete Comment"
      description={
        <>
          Are you sure you want to delete Comment? This Action cannot be undone.
          {error ? (
            <Box component="span" sx={{ display: "block", mt: 1.5, color: "#d92d20" }}>
              {error}
            </Box>
          ) : null}
        </>
      }
      confirmLabel="Delete"
      cancelLabel="Cancel"
      confirmColor="danger"
      loading={loading}
      onConfirm={() => void onConfirm()}
      onCancel={onClose}
    />
  );
}
