import React, { FC } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { Input, Field, Form, Button, FieldSet, VerticalGroup } from '@grafana/ui'; import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences'; import { contextSrv } from 'app/core/core'; import { AccessControlAction, Team } from 'app/types'; import { updateTeam } from './state/actions'; const mapDispatchToProps = { updateTeam, }; const connector = connect(null, mapDispatchToProps); interface OwnProps { team: Team; } export type Props = ConnectedProps & OwnProps; export const TeamSettings: FC = ({ team, updateTeam }) => { const canWriteTeamSettings = contextSrv.hasPermissionInMetadata(AccessControlAction.ActionTeamsWrite, team); return (
{ updateTeam(formTeam.name, formTeam.email); }} disabled={!canWriteTeamSettings} > {({ register }) => ( <> )}
); }; export default connector(TeamSettings);