import { CustomDialog } from "@repo/rdx-ui/components";
import { useTranslation } from "../../../i18n";

type UnsavedChangesDialogProps = {
  open: boolean;
  onConfirm: (ok: boolean) => void;
};

export function UnsavedChangesDialog({ open, onConfirm }: UnsavedChangesDialogProps) {
  const { t } = useTranslation();

  return <CustomDialog
    open={open}
    onConfirm={onConfirm}
    title={t("hooks.unsaved_changes_dialog.title", "¿Descartar cambios?")}
    description={t(
      "hooks.unsaved_changes_dialog.description",
      "Tienes cambios sin guardar. Si sales de esta página, se perderán."
    )}
    cancelLabel={t("hooks.unsaved_changes_dialog.cancel", "Seguir en esta página")}
    confirmLabel={t("hooks.unsaved_changes_dialog.confirm", "Descartar cambios")}
  />
}
