"use client"; import Link from "next/link"; import Image from "next/image"; import type { CliCatalogEntry } from "@/shared/schemas/cliCatalog"; import type { ToolBatchStatus } from "@/shared/types/cliBatchStatus"; import CliStatusBadge from "@/app/(dashboard)/dashboard/cli-code/components/CliStatusBadge"; import { cn } from "@/shared/utils/cn"; export interface CliToolCardProps { tool: CliCatalogEntry; batchStatus: ToolBatchStatus | null; detailHref: string; hasActiveProviders: boolean; } export default function CliToolCard({ tool, batchStatus, detailHref, hasActiveProviders, }: CliToolCardProps) { const installed = batchStatus?.detection.installed ?? false; const configStatus = batchStatus?.config.status ?? null; const version = batchStatus?.detection.version ?? "not found"; const endpoint = batchStatus?.config.endpoint ?? null; const showInstallChips = !installed && tool.configType !== "guide"; const title = (
{/* Icon / image */} {tool.image ? ( {tool.name} ) : ( )}
{tool.name} {version}

{tool.description}

chevron_right
); return ( {/* Header */} {title} {/* Status strip */}
{/* Detection */} {installed ? "Detectado" : "Não detectado"} {/* Config status */} {configStatus && ( )} {/* Endpoint */} {endpoint && ( {endpoint} )}
{/* Badges row */}
{tool.baseUrlSupport === "partial" && ( Base URL parcial )} {tool.acpSpawnable === true && ( também ACP )} {showInstallChips && ( <> 📋 Manual config ⬇ Install )}
{/* Footer */}
{installed ? "Configurar →" : "Como instalar →"} {!hasActiveProviders && ( Conecte um provider em Providers )}
); }