'use client' import { useState } from 'react' import { services } from '../data' import { getServiceTypeColor, getMethodColor } from '../helpers' export default function ApiReferenceTab() { const [copiedEndpoint, setCopiedEndpoint] = useState(null) const copyToClipboard = (text: string, id: string) => { navigator.clipboard.writeText(text) setCopiedEndpoint(id) setTimeout(() => setCopiedEndpoint(null), 2000) } return (
{services.filter(s => s.endpoints.length > 0).map((service) => (

{service.name}

Base URL: http://localhost:{service.port}
{service.type}
{service.endpoints.map((endpoint, idx) => { const endpointId = `${service.id}-${idx}` const curlCommand = `curl -X ${endpoint.method} http://localhost:${service.port}${endpoint.path}` return (
{endpoint.method} {endpoint.path}
{endpoint.description}
) })}
))}
) }