import React from 'react'; import { Search, CircleDashed, CheckCircle, AlertTriangle, ExternalLink, } from 'lucide-react'; import { ToolViewProps } from './types'; import { extractSearchQuery, extractSearchResults, cleanUrl, formatTimestamp, getToolTitle, } from './utils'; import { cn } from '@/lib/utils'; export function WebSearchToolView({ name = 'web-search', assistantContent, toolContent, assistantTimestamp, toolTimestamp, isSuccess = true, isStreaming = false, }: ToolViewProps) { const query = extractSearchQuery(assistantContent); const searchResults = extractSearchResults(toolContent); const toolTitle = getToolTitle(name); return (
{query || 'Unknown query'}
Searching the web...
This might take a moment
{result.snippet}
)}No results found
Try refining your search query