Keycloak
1import { useTranslation } from "react-i18next";
2import { TextControl, TextAreaControl } from "ui-shared";
3
4import { FormAccess } from "../components/form/FormAccess";
5import { DefaultSwitchControl } from "../components/SwitchControl";
6
7type ClientDescriptionProps = {
8protocol?: string;
9hasConfigureAccess?: boolean;
10};
11
12export const ClientDescription = ({
13hasConfigureAccess: configure,
14}: ClientDescriptionProps) => {
15const { t } = useTranslation();
16return (
17<FormAccess role="manage-clients" fineGrainedAccess={configure} unWrap>
18<TextControl
19name="clientId"
20label={t("clientId")}
21labelIcon={t("clientIdHelp")}
22rules={{ required: { value: true, message: t("required") } }}
23/>
24<TextControl
25name="name"
26label={t("name")}
27labelIcon={t("clientNameHelp")}
28/>
29<TextAreaControl
30name="description"
31label={t("description")}
32labelIcon={t("clientDescriptionHelp")}
33rules={{
34maxLength: {
35value: 255,
36message: t("maxLength", { length: 255 }),
37},
38}}
39/>
40<DefaultSwitchControl
41name="alwaysDisplayInConsole"
42label={t("alwaysDisplayInUI")}
43labelIcon={t("alwaysDisplayInUIHelp")}
44/>
45</FormAccess>
46);
47};
48