2020-09-17 13:51:40 +00:00
|
|
|
import React from "react";
|
2020-09-03 19:25:05 +00:00
|
|
|
import { FormGroup, TextInput } from "@patternfly/react-core";
|
2020-09-17 13:51:40 +00:00
|
|
|
import { FieldElement, ValidationRules, Ref } from "react-hook-form";
|
2020-09-10 18:04:03 +00:00
|
|
|
import { useTranslation } from "react-i18next";
|
2020-09-03 19:25:05 +00:00
|
|
|
|
|
|
|
type ClientDescriptionProps = {
|
2020-09-17 13:51:40 +00:00
|
|
|
register<TFieldElement extends FieldElement>(
|
|
|
|
rules?: ValidationRules
|
|
|
|
): (ref: (TFieldElement & Ref) | null) => void;
|
2020-09-03 19:25:05 +00:00
|
|
|
};
|
|
|
|
|
2020-09-17 13:51:40 +00:00
|
|
|
export const ClientDescription = ({ register }: ClientDescriptionProps) => {
|
2020-09-10 18:04:03 +00:00
|
|
|
const { t } = useTranslation("clients");
|
2020-09-03 19:25:05 +00:00
|
|
|
return (
|
|
|
|
<>
|
2020-09-16 14:56:23 +00:00
|
|
|
<FormGroup label={t("clientID")} fieldId="kc-client-id">
|
2020-09-03 19:25:05 +00:00
|
|
|
<TextInput
|
2020-09-17 13:51:40 +00:00
|
|
|
ref={register()}
|
2020-09-03 19:25:05 +00:00
|
|
|
type="text"
|
|
|
|
id="kc-client-id"
|
|
|
|
name="clientId"
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
2020-09-16 14:56:23 +00:00
|
|
|
<FormGroup label={t("name")} fieldId="kc-name">
|
2020-09-17 13:51:40 +00:00
|
|
|
<TextInput ref={register()} type="text" id="kc-name" name="name" />
|
2020-09-03 19:25:05 +00:00
|
|
|
</FormGroup>
|
2020-09-16 14:56:23 +00:00
|
|
|
<FormGroup label={t("description")} fieldId="kc-description">
|
2020-09-03 19:25:05 +00:00
|
|
|
<TextInput
|
2020-09-17 13:51:40 +00:00
|
|
|
ref={register()}
|
2020-09-03 19:25:05 +00:00
|
|
|
type="text"
|
|
|
|
id="kc-description"
|
|
|
|
name="description"
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|