diff --git a/frontend/src/components/elements/Empty.module.css b/frontend/src/components/elements/Empty.module.css new file mode 100644 index 0000000..32f217d --- /dev/null +++ b/frontend/src/components/elements/Empty.module.css @@ -0,0 +1,4 @@ +.Empty { + opacity: 0.5; + font-style: italic; +} \ No newline at end of file diff --git a/frontend/src/components/elements/Empty.tsx b/frontend/src/components/elements/Empty.tsx new file mode 100644 index 0000000..7f6febf --- /dev/null +++ b/frontend/src/components/elements/Empty.tsx @@ -0,0 +1,18 @@ +import {faExpand} from "@fortawesome/free-solid-svg-icons" +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" +import * as React from "react" +import Style from "./Empty.module.css" + + +export interface EmptyProps { + children: React.ReactNode, +} + + +export function Empty({children}: EmptyProps): JSX.Element { + return ( + + {children} + + ) +} diff --git a/frontend/src/components/notebook/NotebookListBox.tsx b/frontend/src/components/notebook/NotebookListBox.tsx index 77cde43..6487883 100644 --- a/frontend/src/components/notebook/NotebookListBox.tsx +++ b/frontend/src/components/notebook/NotebookListBox.tsx @@ -2,6 +2,8 @@ import {Box, Heading} from "@steffo/bluelib-react" import * as React from "react" import {ManagedViewSet} from "../../hooks/useManagedViewSet" import {SophonNotebook} from "../../types/SophonTypes" +import {Empty} from "../elements/Empty" +import {Loading} from "../elements/Loading" import {NotebookResourcePanel} from "./NotebookResourcePanel" @@ -11,6 +13,19 @@ export interface NotebookListBoxProps { export function NotebookListBox({viewSet}: NotebookListBoxProps): JSX.Element { + const resources = React.useMemo( + () => { + if(!viewSet.resources) { + return + } + if(viewSet.resources.length === 0) { + return This project has no notebooks. + } + return viewSet.resources?.map(res => ) + }, + [viewSet], + ) + return ( @@ -19,7 +34,7 @@ export function NotebookListBox({viewSet}: NotebookListBoxProps): JSX.Element { Notebooks are interactive Python documents that you can edit in your browser and run on Sophon server. - {viewSet.resources?.map(res => )} + {resources} ) }
Notebooks are interactive Python documents that you can edit in your browser and run on Sophon server.