"use client";

import ConfirmModal from "../common/ConfirmModal";

export default function DeleteProductModal({
  open,
  count,
  loading = false,
  onClose,
  onConfirm,
  noun = "Product",
}: {
  open: boolean;
  count: number;
  loading?: boolean;
  onClose: () => void;
  onConfirm: () => void;
  noun?: string;
}) {
  const isBulk = count > 1;
  const nounLower = noun.toLowerCase();

  return (
    <ConfirmModal
      open={open}
      title={isBulk ? `Delete ${noun}s` : `Delete ${noun}`}
      description={
        isBulk
          ? `Are you sure you want to delete these selected ${nounLower}s? This action cannot be undone.`
          : `Are you sure you want to delete this ${nounLower}? This action cannot be undone.`
      }
      confirmLabel={loading ? "Deleting..." : "Confirm Delete"}
      confirmButtonClassName="bg-[#DC2626] hover:bg-[#B91C1C]"
      onClose={onClose}
      onConfirm={onConfirm}
      width="400px"
      showCloseIcon
    />
  );
}
