2020-09-03 19:25:05 +00:00
|
|
|
import React, { FormEvent } from "react";
|
|
|
|
import { FormGroup, TextInput } from "@patternfly/react-core";
|
|
|
|
|
2020-09-10 18:04:03 +00:00
|
|
|
import { ClientRepresentation } from "./models/client-model";
|
|
|
|
import { useTranslation } from "react-i18next";
|
2020-09-03 19:25:05 +00:00
|
|
|
|
|
|
|
type ClientDescriptionProps = {
|
|
|
|
onChange: (value: string, event: FormEvent<HTMLInputElement>) => void;
|
|
|
|
client: ClientRepresentation;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const ClientDescription = ({
|
|
|
|
client,
|
|
|
|
onChange,
|
|
|
|
}: ClientDescriptionProps) => {
|
2020-09-10 18:04:03 +00:00
|
|
|
const { t } = useTranslation("clients");
|
2020-09-03 19:25:05 +00:00
|
|
|
return (
|
|
|
|
<>
|
2020-09-10 18:04:03 +00:00
|
|
|
<FormGroup label={t("Client ID")} fieldId="kc-client-id">
|
2020-09-03 19:25:05 +00:00
|
|
|
<TextInput
|
|
|
|
type="text"
|
|
|
|
id="kc-client-id"
|
|
|
|
name="clientId"
|
|
|
|
value={client.clientId}
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
2020-09-10 18:04:03 +00:00
|
|
|
<FormGroup label={t("Name")} fieldId="kc-name">
|
2020-09-03 19:25:05 +00:00
|
|
|
<TextInput
|
|
|
|
type="text"
|
|
|
|
id="kc-name"
|
|
|
|
name="name"
|
|
|
|
value={client.name}
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
2020-09-10 18:04:03 +00:00
|
|
|
<FormGroup label={t("Description")} fieldId="kc-description">
|
2020-09-03 19:25:05 +00:00
|
|
|
<TextInput
|
|
|
|
type="text"
|
|
|
|
id="kc-description"
|
|
|
|
name="description"
|
|
|
|
value={client.description}
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|