Appearance tweaks, fix new message bug
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { useEffect, useRef, useState } from "preact/hooks";
|
||||
import { Search } from "lucide-preact";
|
||||
import type { SearchDetail } from "@/lib/api";
|
||||
import { MarkdownContent } from "@/components/markdown/markdown-content";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -27,11 +26,10 @@ type Props = {
|
||||
search: SearchDetail | null;
|
||||
isLoading: boolean;
|
||||
isRunning: boolean;
|
||||
showPrompt?: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export function SearchResultsPanel({ search, isLoading, isRunning, showPrompt = true, className }: Props) {
|
||||
export function SearchResultsPanel({ search, isLoading, isRunning, className }: Props) {
|
||||
const ANSWER_COLLAPSED_HEIGHT_CLASS = "h-[3rem]";
|
||||
const [isAnswerExpanded, setIsAnswerExpanded] = useState(false);
|
||||
const [canExpandAnswer, setCanExpandAnswer] = useState(false);
|
||||
@@ -159,14 +157,6 @@ export function SearchResultsPanel({ search, isLoading, isRunning, showPrompt =
|
||||
<p className="text-sm text-muted-foreground">{isRunning ? "Searching Exa..." : "Loading search..."}</p>
|
||||
) : null}
|
||||
|
||||
{showPrompt && !isLoading && !search?.query ? (
|
||||
<div className="flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed p-8 text-center">
|
||||
<Search className="h-6 w-6 text-muted-foreground" />
|
||||
<h2 className="text-lg font-semibold">Search the web</h2>
|
||||
<p className="text-sm text-muted-foreground">Use the composer below to run a new Exa search.</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{!isLoading && !isRunning && !!search?.query && search.results.length === 0 ? (
|
||||
<p className="text-sm text-muted-foreground">No results found.</p>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user