"use client";

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { FIX_PACKAGES_ADMIN } from "@/lib/strings";
import type { FixPackage } from "@/features/packages/services/fix-packages.service";

interface DeleteFixPackageDialogProps {
  package: FixPackage | null;
  open: boolean;
  onOpenChange: (open: boolean) => void;
  onConfirm: () => void;
}

export function DeleteFixPackageDialog({
  package: pkg,
  open,
  onOpenChange,
  onConfirm,
}: DeleteFixPackageDialogProps) {
  return (
    <AlertDialog open={open} onOpenChange={onOpenChange}>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>
            {FIX_PACKAGES_ADMIN.DELETE_PACKAGE_TITLE}
          </AlertDialogTitle>
          <AlertDialogDescription>
            {FIX_PACKAGES_ADMIN.DELETE_PACKAGE_DESCRIPTION_PREFIX}{" "}
            <strong>{pkg?.name}</strong>
            {FIX_PACKAGES_ADMIN.DELETE_PACKAGE_DESCRIPTION_SUFFIX}
          </AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel>
            {FIX_PACKAGES_ADMIN.DIALOG_CANCEL}
          </AlertDialogCancel>
          <AlertDialogAction
            onClick={onConfirm}
            className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
          >
            {FIX_PACKAGES_ADMIN.DELETE_PACKAGE_CONFIRM}
          </AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
}
