@@ -9,6 +9,7 @@ import { a11yProps, TabPanel } from "./tabs/TabComponent";
99import DatasetCard from "./datasets/DatasetCard" ;
1010import { ArrowBack , ArrowForward } from "@material-ui/icons" ;
1111import Layout from "./Layout" ;
12+ import { Link as RouterLink , useLocation } from "react-router-dom" ;
1213import { Listeners } from "./listeners/Listeners" ;
1314import { ErrorModal } from "./errors/ErrorModal" ;
1415
@@ -100,7 +101,7 @@ export const Explore = (): JSX.Element => {
100101 </ Box >
101102 < TabPanel value = { selectedTabIndex } index = { 0 } >
102103 < Grid container spacing = { 2 } >
103- { datasets !== undefined ? (
104+ { datasets !== undefined ? (
104105 datasets . map ( ( dataset ) => {
105106 return (
106107 < Grid item key = { dataset . id } xs = { 12 } sm = { 6 } md = { 4 } lg = { 3 } >
@@ -118,28 +119,47 @@ export const Explore = (): JSX.Element => {
118119 ) : (
119120 < > </ >
120121 ) }
122+ { datasets . length === 0 ? (
123+ < Grid container justifyContent = "center" >
124+ < Box textAlign = "center" >
125+ < p > Nobody has created any datasets on this instance. Click below to create a dataset!</ p >
126+ < Button component = { RouterLink } to = "/create-dataset"
127+ variant = "contained"
128+ sx = { { m : 2 } }
129+ >
130+ Create Dataset
131+ </ Button >
132+ </ Box >
133+ </ Grid >
134+ ) : (
135+ < > </ >
136+ ) }
121137 </ Grid >
122- < Box display = "flex" justifyContent = "center" sx = { { m : 1 } } >
123- < ButtonGroup
124- variant = "contained"
125- aria-label = "previous next buttons"
126- >
127- < Button
128- aria-label = "previous"
129- onClick = { previous }
130- disabled = { prevDisabled }
131- >
132- < ArrowBack /> Prev
133- </ Button >
134- < Button
135- aria-label = "next"
136- onClick = { next }
137- disabled = { nextDisabled }
138+ { datasets . length !== 0 ? (
139+ < Box display = "flex" justifyContent = "center" sx = { { m : 1 } } >
140+ < ButtonGroup
141+ variant = "contained"
142+ aria-label = "previous next buttons"
138143 >
139- Next < ArrowForward />
140- </ Button >
141- </ ButtonGroup >
142- </ Box >
144+ < Button
145+ aria-label = "previous"
146+ onClick = { previous }
147+ disabled = { prevDisabled }
148+ >
149+ < ArrowBack /> Prev
150+ </ Button >
151+ < Button
152+ aria-label = "next"
153+ onClick = { next }
154+ disabled = { nextDisabled }
155+ >
156+ Next < ArrowForward />
157+ </ Button >
158+ </ ButtonGroup >
159+ </ Box >
160+ ) : (
161+ < > </ >
162+ ) }
143163 </ TabPanel >
144164 < TabPanel value = { selectedTabIndex } index = { 1 } >
145165 < Listeners />
0 commit comments