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';
|
|
|
|
|
2023-02-02 20:59:38 +01:00
|
|
|
export default function TeamMembers({ teamId, readOnly }) {
|
2023-01-10 08:59:26 +01:00
|
|
|
const { get, useQuery } = useApi();
|
2023-02-02 03:39:54 +01:00
|
|
|
const { data, isLoading } = useQuery(['teams:users', teamId], () =>
|
2023-01-10 08:59:26 +01:00
|
|
|
get(`/teams/${teamId}/users`),
|
|
|
|
);
|
|
|
|
|
|
|
|
if (isLoading) {
|
|
|
|
return <Loading icon="dots" position="block" />;
|
|
|
|
}
|
|
|
|
|
2023-02-02 20:59:38 +01:00
|
|
|
return <TeamMembersTable data={data} readOnly={readOnly} />;
|
2023-01-10 08:59:26 +01:00
|
|
|
}
|