grafana/public/app/features/profile/UserTeams.tsx
Josh Hunt 3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00

58 lines
1.4 KiB
TypeScript

import React, { PureComponent } from 'react';
import { LoadingPlaceholder } from '@grafana/ui';
import { Team } from 'app/types';
export interface Props {
teams: Team[];
isLoading: boolean;
}
export class UserTeams extends PureComponent<Props> {
render() {
const { isLoading, teams } = this.props;
if (isLoading) {
return <LoadingPlaceholder text="Loading teams..." />;
}
if (teams.length === 0) {
return null;
}
return (
<div>
<h3 className="page-sub-heading">Teams</h3>
<div className="gf-form-group">
<table className="filter-table form-inline" aria-label="User teams table">
<thead>
<tr>
<th />
<th>Name</th>
<th>Email</th>
<th>Members</th>
</tr>
</thead>
<tbody>
{teams.map((team: Team, index) => {
return (
<tr key={index}>
<td className="width-4 text-center">
<img className="filter-table__avatar" src={team.avatarUrl} alt="" />
</td>
<td>{team.name}</td>
<td>{team.email}</td>
<td>{team.memberCount}</td>
</tr>
);
})}
</tbody>
</table>
</div>
</div>
);
}
}
export default UserTeams;