grafana/public/app/features/org/OrgProfile.tsx
kay delaney 816d70a7e5
A11y: Fix fastpass issues for /org/ pages (#39902)
* A11y: Fix fastpass issues for /org/ pages
See #39429
2021-10-01 15:58:18 +01:00

30 lines
777 B
TypeScript

import React, { FC } from 'react';
import { Input, Field, FieldSet, Button, Form } from '@grafana/ui';
export interface Props {
orgName: string;
onSubmit: (orgName: string) => void;
}
interface FormDTO {
orgName: string;
}
const OrgProfile: FC<Props> = ({ onSubmit, orgName }) => {
return (
<Form defaultValues={{ orgName }} onSubmit={({ orgName }: FormDTO) => onSubmit(orgName)}>
{({ register }) => (
<FieldSet label="Organization profile">
<Field label="Organization name">
<Input id="org-name-input" type="text" {...register('orgName', { required: true })} />
</Field>
<Button type="submit">Update organization name</Button>
</FieldSet>
)}
</Form>
);
};
export default OrgProfile;