diff --git a/src/renderer/components/Data/DataStore.tsx b/src/renderer/components/Data/DataStore.tsx index 598a51a8..c12326ac 100644 --- a/src/renderer/components/Data/DataStore.tsx +++ b/src/renderer/components/Data/DataStore.tsx @@ -70,15 +70,16 @@ export default function DataStore() { > {data && - filterByFilters(data, searchText).map((row) => ( + data.data && + filterByFilters(data.data, searchText).map((row) => ( diff --git a/src/renderer/components/Data/DatasetCard.tsx b/src/renderer/components/Data/DatasetCard.tsx index 1f6fb2d3..b9d94cbe 100644 --- a/src/renderer/components/Data/DatasetCard.tsx +++ b/src/renderer/components/Data/DatasetCard.tsx @@ -1,4 +1,3 @@ -import * as React from 'react'; import { useState } from 'react'; import { @@ -11,7 +10,12 @@ import { ModalDialog, Typography, } from '@mui/joy'; -import { DownloadIcon, FileTextIcon, Trash2Icon } from 'lucide-react'; +import { + DownloadIcon, + FileTextIcon, + Trash2Icon, + CheckIcon, +} from 'lucide-react'; import { formatBytes } from 'renderer/lib/utils'; import * as chatAPI from '../../lib/transformerlab-api-sdk'; @@ -25,14 +29,14 @@ export default function DatasetCard({ size, description, repo, - download = false, + downloaded, location, parentMutate, + local, }) { const [installing, setInstalling] = useState(null); - const [previewDatasetModalOpen, setPreviewDatasetModalOpen] = - React.useState(false); - const [datasetInfoModalOpen, setDatasetInfoModalOpen] = React.useState(false); + const [previewDatasetModalOpen, setPreviewDatasetModalOpen] = useState(false); + const [datasetInfoModalOpen, setDatasetInfoModalOpen] = useState(false); return ( <> @@ -81,7 +85,7 @@ export default function DatasetCard({ - {!download && ( + {downloaded && local && ( <> )} diff --git a/src/renderer/components/Data/DatasetInfoModal.tsx b/src/renderer/components/Data/DatasetInfoModal.tsx index 440f3f18..946abe12 100644 --- a/src/renderer/components/Data/DatasetInfoModal.tsx +++ b/src/renderer/components/Data/DatasetInfoModal.tsx @@ -1,5 +1,4 @@ /* eslint-disable camelcase */ -import React, { useEffect, useState } from 'react'; import useSWR from 'swr'; import { diff --git a/src/renderer/components/Data/LocalDatasets.tsx b/src/renderer/components/Data/LocalDatasets.tsx index b841ab8c..3b91ed8a 100644 --- a/src/renderer/components/Data/LocalDatasets.tsx +++ b/src/renderer/components/Data/LocalDatasets.tsx @@ -107,7 +107,6 @@ export default function LocalDatasets() { }} > - {data && console.log(data)} {data && filterByFiltersDatasetID(data, searchText).map((row) => ( @@ -118,6 +117,8 @@ export default function LocalDatasets() { description={row?.description} repo={row.huggingfacerepo} location={row?.location} + downloaded={true} + local={true} parentMutate={mutate} /> diff --git a/src/renderer/components/Data/PreviewDatasetModal.tsx b/src/renderer/components/Data/PreviewDatasetModal.tsx index 0feb7721..b06622ca 100644 --- a/src/renderer/components/Data/PreviewDatasetModal.tsx +++ b/src/renderer/components/Data/PreviewDatasetModal.tsx @@ -1,5 +1,5 @@ /* eslint-disable camelcase */ -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import useSWR from 'swr'; import { Button,