"use client"

import { useTranslations } from "next-intl"

import type { AdminClassListItem } from "../types"
import { ConfirmDeleteDialog } from "@/shared/components/ui/confirm-delete-dialog"

export function ClassDeleteDialog({
  open,
  onOpenChange,
  item,
  onConfirm,
  isWorking,
}: {
  open: boolean
  onOpenChange: (open: boolean) => void
  item: AdminClassListItem | null
  onConfirm: () => Promise<void>
  isWorking: boolean
}) {
  const t = useTranslations("classes")
  return (
    <ConfirmDeleteDialog
      open={open}
      onOpenChange={onOpenChange}
      title={t("delete.title")}
      description={t("delete.description", { name: item?.name || t("delete.thisClass") })}
      onConfirm={onConfirm}
      isWorking={isWorking}
      confirmText={t("delete.confirm")}
      cancelText={t("delete.cancel")}
    />
  )
}
