import { ToolWithStats } from "@workspace/api-client-react"; import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Star, MessageSquare, Wrench, Scale, Bookmark } from "lucide-react"; import { Link } from "wouter"; import { MiniBars } from "@/components/mini-bars"; import { cn } from "@/lib/utils"; export function ToolCard({ tool, compare, watchlist, }: { tool: ToolWithStats; compare?: { selected: boolean; onToggle: () => void }; watchlist?: { watched: boolean; onToggle: () => void }; }) { return (
{tool.iconUrl ? ( {tool.name} { (e.target as HTMLImageElement).style.display = "none"; }} /> ) : ( )}
{tool.name} {tool.category}
{tool.description}
{tool.tags?.slice(0, 3).map((tag) => ( {tag} ))} {(tool.tags?.length || 0) > 3 && ( +{(tool.tags?.length || 0) - 3} )}
{tool.avgCombined ? tool.avgCombined.toFixed(1) : "N/A"}
{tool.ratingCount}
{watchlist && ( )} {compare && ( )}
); }