1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/project/Project/ProjectInfo/ProjectMembersWidget.tsx

46 lines
1.2 KiB
TypeScript
Raw Normal View History

import {
StyledLink,
StyledProjectInfoWidgetContainer,
StyledSpanLinkText,
} from './ProjectInfo.styles';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { StatusBox } from '../ProjectStats/StatusBox';
interface IProjectMembersWidgetProps {
projectId: string;
memberCount: number;
change?: number;
}
export const ProjectMembersWidget = ({
projectId,
memberCount,
change = 0,
}: IProjectMembersWidgetProps) => {
const { uiConfig } = useUiConfig();
let link = `/admin/users`;
if (uiConfig?.versionInfo?.current?.enterprise) {
link = `/projects/${projectId}/settings/access`;
}
return (
<StyledProjectInfoWidgetContainer
sx={{ padding: theme => theme.spacing(0, 0, 3, 0) }}
>
<StatusBox
title={'Project members'}
boxText={`${memberCount}`}
change={change}
fullWidthBodyText
/>
<StyledLink data-loading to={link}>
<StyledSpanLinkText data-loading>
View all members
</StyledSpanLinkText>
</StyledLink>
2023-01-27 13:00:23 +01:00
</StyledProjectInfoWidgetContainer>
);
};