"use client"; import React, { useState } from "react"; import { useTranslation } from "@/shared/lib/useTranslation"; import { Tabs, Tab, Chip, Card, CardBody, Button } from "@nextui-org/react"; import { ServiceData } from "@/shared/types/marketplace"; import { ProductOverview } from "@/shared/components/marketplace/ProductOverview"; import { ProductNotFound } from "@/shared/components/marketplace/ProductNotFound"; import { FileText, Wrench, Cog, Copy } from "lucide-react"; import { Navigation } from "./Navigation"; import { Footer } from "./Footer"; import Link from "next/link"; import { Price } from "@/shared/components/marketplace/Price"; import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext"; import { NavigationItem } from "@/shared/components/Navigation"; interface DetailProps { product: ServiceData; breadcrumbs?: { link: string; name: string; }[]; url?: string; mcpName?: string; // navigation items navItems?: NavigationItem[]; onCopy: () => void; } export const Detail: React.FC = ({ product, url, mcpName, navItems = [], onCopy, }) => { const { t } = useTranslation(); const [activeTab, setActiveTab] = useState("overview"); const { platformConfig } = usePlatformConfig(); if (!product) { return ; } return (
{/* Classic Product Header */}
{/* Breadcrumb */} {/* Header with title and price */}

{product.name}

{/* Tags */} {product.tags && product.tags.length > 0 && (
{product.tags.map((tag, index) => ( {tag} ))}
)}

{product.short_description || t("No description available")}

{/* Price section */} {product.charge_type && (
{t("Price")}:
)}
{/* Main Content */}
{/* Left side - Main content */}
setActiveTab(key as string)} variant="underlined" color="primary" className="px-6 pt-6" classNames={{ tabList: "gap-6 w-full relative rounded-none p-0 border-b border-gray-200", cursor: "w-full bg-red-600", tab: "max-w-fit px-0 h-12", tabContent: "group-data-[selected=true]:text-red-600 font-semibold text-gray-700", }} > {t("Overview")}
} >
{t("Tools")} {product.tools.length}
} >
{product.tools.length > 0 ? ( product.tools.map((tool, index) => (

{tool.name}

{tool.description || t("No description available")}

)) ) : (

{t("No tools available in this service.")}

)}
{/* Right side - Server Config */}

{t("Configuration")}

{/* Code Snippet */}
{platformConfig?.name} MCP
                        
                          {`{
  "mcpServers": {
    "${mcpName}": {
      "type": "sse",
      "autoApprove":"all",
      "url": "${url}?apikey=`}
                          {`{Your-${platformConfig?.name}-API-Key}`}
                          {`"
    }
  }
}`}
                        
                      
{/* SEO-friendly: Simple text content for search engines */}
); };