From 9b9ea229f188c5987cf2a0d59e5baceb07132456 Mon Sep 17 00:00:00 2001
From: Tony Salomone <dadmobile@gmail.com>
Date: Wed, 3 Jul 2024 14:46:09 -0400
Subject: [PATCH] Add a default message to blank local datasets tab.

---
 .../components/Data/LocalDatasets.tsx         | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/renderer/components/Data/LocalDatasets.tsx b/src/renderer/components/Data/LocalDatasets.tsx
index 3b91ed8a..d2cc0a0a 100644
--- a/src/renderer/components/Data/LocalDatasets.tsx
+++ b/src/renderer/components/Data/LocalDatasets.tsx
@@ -12,13 +12,17 @@ import {
   Sheet,
   CircularProgress,
   FormLabel,
+  Typography
 } from '@mui/joy';
-import { PlusIcon } from 'lucide-react';
-import DatasetCard from './DatasetCard';
-import { SearchIcon } from 'lucide-react';
-import { filterByFilters } from 'renderer/lib/utils';
+import {
+  PlusIcon,
+  SearchIcon,
+  StoreIcon,
+ } from 'lucide-react';
+import { Link as ReactRouterLink } from 'react-router-dom';
 
 import * as chatAPI from '../../lib/transformerlab-api-sdk';
+import DatasetCard from './DatasetCard';
 import NewDatasetModal from './NewDatasetModal';
 
 const fetcher = (url) => fetch(url).then((res) => res.json());
@@ -123,6 +127,22 @@ export default function LocalDatasets() {
                 />
               </Grid>
             ))}
+
+          {data?.length === 0 && (
+              <Typography
+                level="body-lg"
+                justifyContent="center"
+                margin={5}
+              >
+                You do not have any datasets on your local machine. You can
+                download a dataset by going to the{' '}
+                <ReactRouterLink to="/data">
+                  <StoreIcon />
+                  Dataset Store
+                </ReactRouterLink>
+                .
+              </Typography>
+            )}
         </Grid>
       </Sheet>
 
-- 
GitLab