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

41 lines
1.2 KiB
TypeScript
Raw Normal View History

import {
StyledArrowIcon,
2023-01-27 13:00:23 +01:00
StyledProjectInfoWidgetContainer,
StyledLink,
StyledParagraphEmphasizedText,
2023-01-27 13:00:23 +01:00
StyledWidgetTitle,
StyledSpanLinkText,
} from './ProjectInfo.styles';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
interface IProjectMembersWidgetProps {
projectId: string;
memberCount: number;
}
export const ProjectMembersWidget = ({
projectId,
memberCount,
}: IProjectMembersWidgetProps) => {
const { uiConfig } = useUiConfig();
let link = `/admin/users`;
if (uiConfig?.versionInfo?.current?.enterprise) {
link = `/projects/${projectId}/settings/access`;
}
return (
2023-01-27 13:00:23 +01:00
<StyledProjectInfoWidgetContainer>
<StyledWidgetTitle data-loading>Project members</StyledWidgetTitle>
<StyledParagraphEmphasizedText data-loading>
{memberCount}
</StyledParagraphEmphasizedText>
<StyledLink data-loading to={link}>
<StyledSpanLinkText data-loading>view more </StyledSpanLinkText>
<StyledArrowIcon data-loading />
</StyledLink>
2023-01-27 13:00:23 +01:00
</StyledProjectInfoWidgetContainer>
);
};