export function DatabaseSchemaSection() {
  return (
    <div className="space-y-4">
      <p className="text-gray-600 mb-4">
        Das Agent-System nutzt PostgreSQL fuer persistente Daten und Valkey (Redis) fuer Caching und Pub/Sub.
      </p>

      <div className="space-y-4">
        {/* agent_sessions */}
        <div className="bg-white border border-gray-200 rounded-xl p-4">
          <h4 className="font-semibold text-gray-900 mb-2 font-mono">agent_sessions</h4>
          <p className="text-sm text-gray-600 mb-3">Speichert Session-Daten mit Checkpoints</p>
          <div className="bg-gray-50 rounded-lg p-3 font-mono text-xs overflow-x-auto">
            <pre>{`
CREATE TABLE agent_sessions (
    id UUID PRIMARY KEY,
    agent_type VARCHAR(50) NOT NULL,
    user_id UUID REFERENCES users(id),
    state VARCHAR(20) NOT NULL DEFAULT 'active',
    context JSONB DEFAULT '{}',
    checkpoints JSONB DEFAULT '[]',
    created_at TIMESTAMPTZ DEFAULT NOW(),
    updated_at TIMESTAMPTZ DEFAULT NOW(),
    last_heartbeat TIMESTAMPTZ DEFAULT NOW()
);
            `}</pre>
          </div>
        </div>

        {/* agent_memory */}
        <div className="bg-white border border-gray-200 rounded-xl p-4">
          <h4 className="font-semibold text-gray-900 mb-2 font-mono">agent_memory</h4>
          <p className="text-sm text-gray-600 mb-3">Langzeit-Gedaechtnis mit TTL</p>
          <div className="bg-gray-50 rounded-lg p-3 font-mono text-xs overflow-x-auto">
            <pre>{`
CREATE TABLE agent_memory (
    id UUID PRIMARY KEY,
    namespace VARCHAR(100) NOT NULL,
    key VARCHAR(500) NOT NULL,
    value JSONB NOT NULL,
    agent_id VARCHAR(50) NOT NULL,
    access_count INTEGER DEFAULT 0,
    created_at TIMESTAMPTZ DEFAULT NOW(),
    expires_at TIMESTAMPTZ,
    UNIQUE(namespace, key)
);
            `}</pre>
          </div>
        </div>

        {/* agent_messages */}
        <div className="bg-white border border-gray-200 rounded-xl p-4">
          <h4 className="font-semibold text-gray-900 mb-2 font-mono">agent_messages</h4>
          <p className="text-sm text-gray-600 mb-3">Audit-Trail fuer Inter-Agent Kommunikation</p>
          <div className="bg-gray-50 rounded-lg p-3 font-mono text-xs overflow-x-auto">
            <pre>{`
CREATE TABLE agent_messages (
    id UUID PRIMARY KEY,
    sender VARCHAR(50) NOT NULL,
    receiver VARCHAR(50) NOT NULL,
    message_type VARCHAR(50) NOT NULL,
    payload JSONB NOT NULL,
    priority INTEGER DEFAULT 1,
    correlation_id UUID,
    created_at TIMESTAMPTZ DEFAULT NOW()
);
            `}</pre>
          </div>
        </div>
      </div>
    </div>
  )
}
