import React, { PureComponent } from 'react'; import { UserDTO, UserOrg } from 'app/types'; import { LoadingPlaceholder, Button } from '@grafana/ui'; export interface Props { user: UserDTO; orgs: UserOrg[]; isLoading: boolean; loadOrgs: () => void; setUserOrg: (org: UserOrg) => void; } export class UserOrganizations extends PureComponent { componentDidMount() { this.props.loadOrgs(); } render() { const { isLoading, orgs, user } = this.props; if (isLoading) { return ; } return ( <> {orgs.length > 0 && ( <>

Organizations

{orgs.map((org: UserOrg, index) => { return ( ); })}
Name Role
{org.name} {org.role} {org.orgId === user.orgId ? ( Current ) : ( )}
)} ); } } export default UserOrganizations;