-
-
-const GroupMembersCount = connect(
- (state: RootState, props: { uuid: string }) => {
- const group = getResource<GroupResource>(props.uuid)(state.resources);
-
- return {
- value: group?.memberCount,
- };
-
- }
-)(withTheme()((props: {value: number | null | undefined, theme:ArvadosTheme}) => {
- if (props.value === undefined) {
- // Loading
- return <Typography>
- <InlinePulser />
- </Typography>;
- } else if (props.value === null) {
- // Error
- return <Typography>
- <Tooltip title="Failed to load member count">
- <ErrorIcon style={{color: props.theme.customs.colors.greyL}}/>
- </Tooltip>
- </Typography>;
- } else {
- return <Typography children={props.value} />;
- }
-}));