import { useFormContext } from 'react-hook-form'; import { SelectableValue } from '@grafana/data'; import { Box, Button, Field, Input, RadioButtonGroup, Switch } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { t, Trans } from 'app/core/internationalization'; import { LdapPayload, OrgRole } from 'app/types'; const roleOptions: Array> = Object.keys(OrgRole).map((key) => { return { label: key, value: key }; }); interface GroupMappingProps { onRemove: () => void; groupMappingIndex: number; } export const GroupMappingComponent = ({ groupMappingIndex, onRemove }: GroupMappingProps) => { const { getValues, register, setValue } = useFormContext(); return ( setValue(`settings.config.servers.0.group_mappings.${groupMappingIndex}.org_role`, v)} /> {contextSrv.isGrafanaAdmin && ( )} ); };