add cleaner / consolidate no docs found message (#2119)

This commit is contained in:
pablodanswer
2024-08-12 16:04:59 -07:00
committed by GitHub
parent 26df869b91
commit 83e945ba57
2 changed files with 7 additions and 15 deletions

View File

@@ -35,8 +35,10 @@ export const SearchResultsDisplay = ({
isFetching,
defaultOverrides,
performSweep,
searchState,
sweep,
}: {
searchState: searchState;
disabledAgentic?: boolean;
contentEnriched?: boolean;
agenticResults?: boolean | null;
@@ -92,16 +94,11 @@ export const SearchResultsDisplay = ({
if (isFetching && !answer && !documents) {
return null;
}
if (
answer === null &&
documents != null &&
documents.length == 0 &&
!isFetching
) {
if (documents != null && documents.length == 0 && searchState == "input") {
return (
<div className="text-base gap-x-1.5 flex flex-col">
<div className="flex gap-x-2 items-center text-error">
<AlertIcon size={16} className="text-error" />
<div className="flex gap-x-2 items-center font-semibold">
<AlertIcon size={16} />
No documents were found!
</div>
<p>
@@ -114,7 +111,6 @@ export const SearchResultsDisplay = ({
if (
answer === null &&
(documents === null || documents.length === 0) &&
quotes === null &&
!isFetching
) {
return (
@@ -167,12 +163,6 @@ export const SearchResultsDisplay = ({
<>
{popup}
{documents && documents.length == 0 && (
<p className="flex text-lg font-bold">
No docs found! Ensure that you have enabled at least one connector
</p>
)}
{documents && documents.length > 0 && (
<div className="mt-4">
<div className="font-bold flex justify-between text-emphasis border-b mb-3 pb-1 border-border text-lg">

View File

@@ -664,6 +664,7 @@ export const SearchSection = ({
<div className="mt-6">
{!(agenticResults && isFetching) || disabledAgentic ? (
<SearchResultsDisplay
searchState={searchState}
disabledAgentic={disabledAgentic}
contentEnriched={contentEnriched}
comments={comments}
@@ -736,6 +737,7 @@ export const SearchSection = ({
<div className="mt-6">
{!(agenticResults && isFetching) || disabledAgentic ? (
<SearchResultsDisplay
searchState={searchState}
disabledAgentic={disabledAgentic}
contentEnriched={contentEnriched}
comments={comments}