diff --git a/client/src/components/SearchModal.tsx b/client/src/components/SearchModal.tsx index f6ee415..69f9fa7 100644 --- a/client/src/components/SearchModal.tsx +++ b/client/src/components/SearchModal.tsx @@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query"; import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; -import { Search } from "lucide-react"; +import { Search, X } from "lucide-react"; import { Link } from "wouter"; import type { MediaOutlet, Article } from "@shared/schema"; @@ -59,10 +59,10 @@ export default function SearchModal({ isOpen, onClose }: SearchModalProps) { return ( - + Search Articles and Media Outlets {/* Search Header */} -
+
+
{/* Search Results */} -
+
{!debouncedQuery.trim() ? ( /* Empty State */ -
-

Start typing to search articles and outlets

+
+

Start typing to search articles and outlets

) : isLoading ? ( /* Loading State */ -
+
{Array.from({ length: 5 }).map((_, i) => (
-
+
))}
) : totalResults === 0 ? ( /* No Results */ -
-

No results found for "{debouncedQuery}"

-

Try a different search term

+
+

No results found for "{debouncedQuery}"

+

Try a different search term

) : ( /* Search Results */ <> -
+
{totalResults} results found
{/* Outlets Section */} {searchResults && searchResults.outlets.length > 0 && ( -
-

+
+

Outlets ({searchResults.outlets.length})

-
+
{searchResults.outlets.map((outlet) => ( -
-
+
+
{outlet.imageUrl ? ( ) : ( - + {outlet.name.charAt(0)} )}
-
-

+
+

{outlet.name}

- + {outlet.category}
-

+

{outlet.description || "Media Outlet"}

@@ -158,10 +166,10 @@ export default function SearchModal({ isOpen, onClose }: SearchModalProps) { {/* Articles Section */} {searchResults && searchResults.articles.length > 0 && (
-

+

Articles ({searchResults.articles.length})

-
+
{searchResults.articles.map((article) => ( -
+
{article.imageUrl && ( -
+
{article.title} )}
-

+

{article.title}

-

+

{article.excerpt || ""}

{article.publishedAt && ( -

+

{new Date(article.publishedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric',