diff --git a/web/src/app/app/_components/NewThreadModal/NewThreadModal.tsx b/web/src/app/app/_components/NewThreadModal/NewThreadModal.tsx index b06abef98..9c87bce4d 100644 --- a/web/src/app/app/_components/NewThreadModal/NewThreadModal.tsx +++ b/web/src/app/app/_components/NewThreadModal/NewThreadModal.tsx @@ -15,6 +15,7 @@ import { useParams } from 'next/navigation'; import { useAppLayoutContextSelector } from '@/context/BusterAppLayout'; import { BusterRoutes } from '@/routes'; import { useGetDatasets } from '@/api/buster_rest/datasets'; +import { NewDatasetModal } from '../NewDatasetModal'; const themeConfig: ThemeConfig = { components: { @@ -49,6 +50,7 @@ export const NewThreadModal = React.memo<{ const prompt = useBusterNewThreadsContextSelector((x) => x.prompt); const onBusterSearch = useBusterSearchContextSelector((x) => x.onBusterSearch); const token = useAntToken(); + const [openNewDatasetModal, setOpenNewDatasetModal] = useState(false); const [suggestedPrompts, setSuggestedPrompts] = useState([]); const [activeItem, setActiveItem] = useState(null); const [defaultSuggestedPrompts, setDefaultSuggestedPrompts] = useState([]); @@ -163,7 +165,9 @@ export const NewThreadModal = React.memo<{ )} - {!hasDatasets && } + {!hasDatasets && ( + + )} {hasDatasets && showSuggested && } @@ -178,6 +182,14 @@ export const NewThreadModal = React.memo<{ /> )} + + {!hasDatasets && ( + setOpenNewDatasetModal(false)} + afterCreate={onClose} + /> + )} ); }); diff --git a/web/src/app/app/_components/NewThreadModal/NoDatasets.tsx b/web/src/app/app/_components/NewThreadModal/NoDatasets.tsx index 284d05ae5..fd6d44a6a 100644 --- a/web/src/app/app/_components/NewThreadModal/NoDatasets.tsx +++ b/web/src/app/app/_components/NewThreadModal/NoDatasets.tsx @@ -1,12 +1,12 @@ -import React, { useState } from 'react'; +import React from 'react'; import { Button } from 'antd'; import { Text, Title } from '@/components/text'; import { AppMaterialIcons } from '@/components/icons'; -import { NewDatasetModal } from '@appComponents/NewDatasetModal'; - -export const NoDatasets: React.FC<{ onClose: () => void }> = React.memo(({ onClose }) => { - const [openNewDatasetModal, setOpenNewDatasetModal] = useState(false); +export const NoDatasets: React.FC<{ + onClose: () => void; + setOpenNewDatasetModal: (open: boolean) => void; +}> = React.memo(({ onClose, setOpenNewDatasetModal }) => { return ( <>
@@ -17,6 +17,7 @@ export const NoDatasets: React.FC<{ onClose: () => void }> = React.memo(({ onClo
- - setOpenNewDatasetModal(false)} - afterCreate={onClose} - /> ); }); diff --git a/web/src/app/app/metrics/_ThreadControllerEmptyState.tsx b/web/src/app/app/metrics/_ThreadControllerEmptyState.tsx deleted file mode 100644 index 7c6c22903..000000000 --- a/web/src/app/app/metrics/_ThreadControllerEmptyState.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Empty } from 'antd'; -import React from 'react'; - -export const ThreadControllerEmptyState: React.FC<{ - className?: string; -}> = ({ className = '' }) => { - return ( -
- -
- ); -};