mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 07:14:21 +00:00
🔧 Add status text to the ProjectListBox
This commit is contained in:
parent
5e74e9b8d7
commit
955aa52503
1 changed files with 16 additions and 1 deletions
|
@ -2,6 +2,8 @@ import {Box, Heading} from "@steffo/bluelib-react"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import {ManagedViewSet} from "../../hooks/useManagedViewSet"
|
import {ManagedViewSet} from "../../hooks/useManagedViewSet"
|
||||||
import {SophonResearchProject} from "../../types/SophonTypes"
|
import {SophonResearchProject} from "../../types/SophonTypes"
|
||||||
|
import {Empty} from "../elements/Empty"
|
||||||
|
import {Loading} from "../elements/Loading"
|
||||||
import {ProjectResourcePanel} from "./ProjectResourcePanel"
|
import {ProjectResourcePanel} from "./ProjectResourcePanel"
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +13,19 @@ export interface ProjectListBoxProps {
|
||||||
|
|
||||||
|
|
||||||
export function ProjectListBox({viewSet}: ProjectListBoxProps): JSX.Element {
|
export function ProjectListBox({viewSet}: ProjectListBoxProps): JSX.Element {
|
||||||
|
const resources = React.useMemo(
|
||||||
|
() => {
|
||||||
|
if(!viewSet.resources) {
|
||||||
|
return <Loading/>
|
||||||
|
}
|
||||||
|
if(viewSet.resources.length === 0) {
|
||||||
|
return <Empty>This group owns no projects.</Empty>
|
||||||
|
}
|
||||||
|
return viewSet.resources?.map(res => <ProjectResourcePanel resource={res} key={res.value.slug}/>)
|
||||||
|
},
|
||||||
|
[viewSet],
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Heading level={3}>
|
<Heading level={3}>
|
||||||
|
@ -19,7 +34,7 @@ export function ProjectListBox({viewSet}: ProjectListBoxProps): JSX.Element {
|
||||||
<p>
|
<p>
|
||||||
Research projects are containers for all kind of research data pertaining to a specific topic.
|
Research projects are containers for all kind of research data pertaining to a specific topic.
|
||||||
</p>
|
</p>
|
||||||
{viewSet.resources?.map(res => <ProjectResourcePanel resource={res} key={res.value.slug}/>)}
|
{resources}
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue