umami/components/pages/settings/teams/TeamMembers.js

17 lines
479 B
JavaScript
Raw Normal View History

2023-01-10 08:59:26 +01:00
import { Loading } from 'react-basics';
import useApi from 'hooks/useApi';
import TeamMembersTable from 'components/pages/settings/teams/TeamMembersTable';
export default function TeamMembers({ teamId }) {
const { get, useQuery } = useApi();
const { data, isLoading } = useQuery(['team-members', teamId], () =>
get(`/teams/${teamId}/users`),
);
if (isLoading) {
return <Loading icon="dots" position="block" />;
}
return <TeamMembersTable data={data} />;
}