'use client'

import { ApiEndpoint, CodeBlock } from '@/components/DevPortalLayout'

export function OnboardingSection() {
  return (
    <>
      <h2>Onboarding</h2>
      <p>Initialisierung aus Firmenprofil und Vollstaendigkeitspruefung.</p>

      <ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/init-from-profile" description="Projekt aus Company Profile und Compliance Scope initialisieren" />

      <CodeBlock language="bash" filename="cURL">
{`curl -X POST "https://api.breakpilot.io/sdk/v1/iace/projects/proj_a1b2c3d4/init-from-profile" \\
  -H "Authorization: Bearer YOUR_API_KEY"`}
      </CodeBlock>

      <h3>Response (200 OK)</h3>
      <CodeBlock language="json" filename="Response">
{`{
  "success": true,
  "data": {
    "initialized_fields": ["manufacturer", "description", "machine_type"],
    "suggested_regulations": ["machinery_regulation", "low_voltage", "emc"],
    "message": "Projekt aus Firmenprofil initialisiert. 3 Felder uebernommen."
  }
}`}
      </CodeBlock>

      <ApiEndpoint method="POST" path="/sdk/v1/iace/projects/:id/completeness-check" description="Vollstaendigkeitspruefung (25 Gates) durchfuehren" />

      <CodeBlock language="bash" filename="cURL">
{`curl -X POST "https://api.breakpilot.io/sdk/v1/iace/projects/proj_a1b2c3d4/completeness-check" \\
  -H "Authorization: Bearer YOUR_API_KEY"`}
      </CodeBlock>

      <h3>Response (200 OK)</h3>
      <CodeBlock language="json" filename="Response">
{`{
  "success": true,
  "data": {
    "score": 72,
    "total_gates": 25,
    "passed_gates": 18,
    "gates": [
      { "id": "G01", "name": "Maschinenidentifikation", "status": "passed" },
      { "id": "G02", "name": "Komponentenliste", "status": "passed" },
      { "id": "G03", "name": "Regulatorische Klassifizierung", "status": "passed" },
      { "id": "G04", "name": "Gefahrenanalyse", "status": "warning", "message": "3 Gefahren ohne Massnahmen" },
      { "id": "G05", "name": "Risikobewertung", "status": "failed", "message": "5 Gefahren nicht bewertet" }
    ]
  }
}`}
      </CodeBlock>
    </>
  )
}
