'use client' import { useState } from 'react' import { AvatarImage, Avatar, AvatarFallback } from '@/components/ui-v2/avatar' import { CardContent, Card } from '@/components/ui-v2/card' import { Button } from '@/components/ui-v2/button' import Link from 'next/link' export interface SearchResultsProps { results: { title: string; url: string; content: string }[] } export function SearchResults({ results }: SearchResultsProps) { // State to manage whether to display the results const [showAllResults, setShowAllResults] = useState(false) const handleViewMore = () => { setShowAllResults(true) } const displayedResults = showAllResults ? results : results.slice(0, 3) const additionalResultsCount = results.length > 3 ? results.length - 3 : 0 return (
{result.content}