'use client'

import React, { useState } from 'react'
import { ComplianceCheckTab } from './_components/ComplianceCheckTab'
import { ComplianceFAQ } from './_components/ComplianceFAQ'
import { SnapshotHistoryList } from './_components/SnapshotHistoryList'

export default function AgentPage() {
  // Nach einem abgeschlossenen Check die Historie unten neu laden.
  const [historyKey, setHistoryKey] = useState(0)

  return (
    <div className="space-y-6 max-w-4xl">
      <div>
        <h1 className="text-2xl font-bold text-gray-900">Compliance Agent</h1>
        <p className="text-gray-500 mt-1">Webseiten + Dokumente auf DSGVO-Konformität prüfen.</p>
      </div>

      <ComplianceCheckTab onComplete={() => setHistoryKey(k => k + 1)} />

      <SnapshotHistoryList refreshKey={historyKey} />

      <ComplianceFAQ />
    </div>
  )
}
