24 lines
803 B
TypeScript
24 lines
803 B
TypeScript
import { ContextHelp } from "@repo/rdx-ui/components/context-help";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import type { HelpKind } from "../../shared/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")}
|
|
/>
|
|
);
|
|
}
|