From b2bfb61ae574a33c4887951fffaad24e7bd2e573 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 7 Oct 2021 19:35:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20status=20text=20to=20the?= =?UTF-8?q?=20`GroupListBox`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/group/GroupListBox.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/group/GroupListBox.tsx b/frontend/src/components/group/GroupListBox.tsx index e5aec7a..503f377 100644 --- a/frontend/src/components/group/GroupListBox.tsx +++ b/frontend/src/components/group/GroupListBox.tsx @@ -2,6 +2,8 @@ import {Box, Heading} from "@steffo/bluelib-react" import * as React from "react" import {ManagedViewSet} from "../../hooks/useManagedViewSet" import {SophonResearchGroup} from "../../types/SophonTypes" +import {Empty} from "../elements/Empty" +import {Loading} from "../elements/Loading" import {GroupResourcePanel} from "./GroupResourcePanel" @@ -11,6 +13,19 @@ export interface GroupListBoxProps { export function GroupListBox({viewSet}: GroupListBoxProps): JSX.Element { + const resources = React.useMemo( + () => { + if(!viewSet.resources) { + return + } + if(viewSet.resources.length === 0) { + return This Sophon instance has no groups. + } + return viewSet.resources?.map(res => ) + }, + [viewSet], + ) + return ( @@ -19,7 +34,7 @@ export function GroupListBox({viewSet}: GroupListBoxProps): JSX.Element {

Research groups are groups of people that work together on one or more research projects.

- {viewSet.resources?.map(res => )} + {resources}
) }