OrgProfile.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React, { ChangeEvent, FC } from 'react';
  2. import { Input } from '@grafana/ui';
  3. export interface Props {
  4. orgName: string;
  5. onSubmit: () => void;
  6. onOrgNameChange: (orgName: string) => void;
  7. }
  8. const OrgProfile: FC<Props> = ({ onSubmit, onOrgNameChange, orgName }) => {
  9. return (
  10. <div>
  11. <h3 className="page-sub-heading">Organization profile</h3>
  12. <form
  13. name="orgForm"
  14. className="gf-form-group"
  15. onSubmit={event => {
  16. event.preventDefault();
  17. onSubmit();
  18. }}
  19. >
  20. <div className="gf-form-inline">
  21. <div className="gf-form max-width-28">
  22. <span className="gf-form-label">Organization name</span>
  23. <Input
  24. className="gf-form-input"
  25. type="text"
  26. onChange={(event: ChangeEvent<HTMLInputElement>) => onOrgNameChange(event.target.value)}
  27. value={orgName}
  28. />
  29. </div>
  30. </div>
  31. <div className="gf-form-button-row">
  32. <button type="submit" className="btn btn-primary">
  33. Save
  34. </button>
  35. </div>
  36. </form>
  37. </div>
  38. );
  39. };
  40. export default OrgProfile;