/** * Access denied state: message and optional server detail. * Ported from webapp/js/ui.js showAccessDenied and states.css .access-denied. */ "use client"; import { useTranslation } from "@/i18n/use-translation"; import { cn } from "@/lib/utils"; export interface AccessDeniedProps { /** Optional detail from API 403 response, shown below the main message. */ serverDetail?: string | null; /** Optional class for the container. */ className?: string; } /** * Displays access denied message; optional second paragraph for server detail. */ export function AccessDenied({ serverDetail, className }: AccessDeniedProps) { const { t } = useTranslation(); const hasDetail = Boolean(serverDetail && String(serverDetail).trim()); return (
{t("access_denied")}
{hasDetail && ({serverDetail}
)}{t("access_denied.hint")}