'use client' import React, { useState } from 'react' import { useAgentAnalysis } from './_hooks/useAgentAnalysis' import { AnalysisResult } from './_components/AnalysisResult' import { AnalysisHistory } from './_components/AnalysisHistory' import { FollowUpQuestions } from './_components/FollowUpQuestions' type AnalysisMode = 'pre_launch' | 'post_launch' const MODES: { id: AnalysisMode; label: string; desc: string; icon: string }[] = [ { id: 'pre_launch', label: 'Internes Dokument pruefen', desc: 'Dokument oder Website VOR Veroeffentlichung pruefen', icon: '📋', }, { id: 'post_launch', label: 'Live-Website pruefen', desc: 'Bereits veroeffentlichte Website oder Dokument analysieren', icon: '🌐', }, ] export default function AgentPage() { const [url, setUrl] = useState('') const [mode, setMode] = useState('post_launch') const { analyze, answerFollowUp, loading, error, result, history } = useAgentAnalysis() const handleSubmit = (e: React.FormEvent) => { e.preventDefault() if (!url.trim()) return analyze(url.trim(), mode) } return (
{/* Header */}

Compliance Agent

Analysiere Dokumente und Webseiten auf DSGVO-Konformitaet.

{/* Mode Selection */}
{MODES.map(m => ( ))}
{/* URL Input */}
setUrl(e.target.value)} placeholder={mode === 'pre_launch' ? 'https://staging.example.com/datenschutz' : 'https://www.example.com/datenschutz'} className="flex-1 px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent text-sm" disabled={loading} required />
{/* Error */} {error && (
{error}
)} {/* Result */} {result && (
{/* Follow-Up Questions */} {result.follow_up_questions.length > 0 && (
)}
)} {/* History */} { setUrl(r.url) analyze(r.url, mode) }} />
) }