grafana/public/app/features/org/OrgProfile.tsx
Peter Holmberg 4898502e4e
refactor(grafana/ui): Replace <input />with Input component from grafana/ui (#16085)
* replace with Input component from grafana/ui

* removing placeholder classname

* change import

* fix import
2019-03-25 15:53:05 +01:00

44 lines
1.2 KiB
TypeScript

import React, { ChangeEvent, FC } from 'react';
import { Input } from '@grafana/ui';
export interface Props {
orgName: string;
onSubmit: () => void;
onOrgNameChange: (orgName: string) => void;
}
const OrgProfile: FC<Props> = ({ onSubmit, onOrgNameChange, orgName }) => {
return (
<div>
<h3 className="page-sub-heading">Organization profile</h3>
<form
name="orgForm"
className="gf-form-group"
onSubmit={event => {
event.preventDefault();
onSubmit();
}}
>
<div className="gf-form-inline">
<div className="gf-form max-width-28">
<span className="gf-form-label">Organization name</span>
<Input
className="gf-form-input"
type="text"
onChange={(event: ChangeEvent<HTMLInputElement>) => onOrgNameChange(event.target.value)}
value={orgName}
/>
</div>
</div>
<div className="gf-form-button-row">
<button type="submit" className="btn btn-primary">
Save
</button>
</div>
</form>
</div>
);
};
export default OrgProfile;