2023-01-26 07:26:43 +01:00
|
|
|
import {
|
|
|
|
StyledArrowIcon,
|
2023-01-27 13:00:23 +01:00
|
|
|
StyledProjectInfoWidgetContainer,
|
2023-01-26 07:26:43 +01:00
|
|
|
StyledLink,
|
|
|
|
StyledParagraphEmphasizedText,
|
2023-01-27 13:00:23 +01:00
|
|
|
StyledWidgetTitle,
|
2023-01-26 07:26:43 +01:00
|
|
|
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>
|
2023-01-26 07:26:43 +01:00
|
|
|
<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>
|
2023-01-26 07:26:43 +01:00
|
|
|
);
|
|
|
|
};
|