feat(web): inline status-aware errors on term/authority edit rows + delete dialog (#63)

This commit is contained in:
2026-06-08 17:27:02 +02:00
parent dd131ee740
commit 6e02ac874f
5 changed files with 62 additions and 4 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { InUseError } from "../api/queries";
import { errorMessageKey } from "../api/error-message";
import {
AlertDialog,
AlertDialogTrigger,
@@ -37,7 +37,8 @@ export function DeleteConfirmDialog({
} catch (err) {
// Keep the dialog open; show the blocking reason. Never let the rejected
// mutation escape as an unhandled rejection.
setMessage(err instanceof InUseError ? t("actions.inUse", { count: err.count }) : t("form.rejected"));
const { key, opts } = errorMessageKey(err);
setMessage(t(key, opts));
return;
}
setOpen(false);