metis-desk/modules/companies/src/web/access/entity-help.tsx
David 8386679181 feat: integrate contextual help across forms and improve user guidance
- Added contextual help to various forms including companies, people, departments, sites, assignments, and access accounts.
- Introduced EntityHelp component to provide descriptions, examples, and guidance for each entity type.
- Updated forms to include help sections before submit buttons, enhancing user understanding of each field's purpose.
- Implemented help translations in Spanish and English for consistency across the application.
- Created a new ContextHelp component for displaying help information in a structured format.
- Added automated tests to ensure help content is correctly rendered in both languages.
- Documented the new contextual help feature in ayuda-contextual.md for user reference.
2026-10-03 18:23:38 +02:00

24 lines
800 B
TypeScript

import { ContextHelp } from "@repo/shadcn-ui/components/context-help";
import { useTranslation } from "react-i18next";
import type { HelpKind } from "./help-i18n";
export function EntityHelp({ kind, scope }: { kind: HelpKind; scope?: string }) {
const { t } = useTranslation("access");
const catalogue = ["system", "resource_type", "permission", "template"].includes(kind);
return (
<ContextHelp
description={t(`helpContent.${kind}.description`)}
examples={t(`helpContent.${kind}.examples`)}
examplesLabel={t("helpExamples")}
guidance={t(`helpContent.${kind}.guidance`)}
scopeNote={
catalogue && scope
? t(scope === "global" ? "helpGlobalScope" : "helpCompanyScope")
: undefined
}
title={t("helpTitle")}
/>
);
}