import { useState } from 'react';
import HistoryTab from '../components/screening/HistoryTab';

export default function RiskComplianceHistory() {
    const [lang, setLang] = useState('KO');

    return (
        <div className="space-y-6">
            {/* 헤더 + 언어 토글 */}
            <div className="flex items-center justify-between">
                <div>
                    <h1 className="text-2xl font-bold text-wing-text">Risk & Compliance Change History</h1>
                    <p className="mt-1 text-sm text-wing-muted">
                        S&P 위험 지표 및 규정 준수 값 변경 이력
                    </p>
                </div>
                <div className="flex border border-wing-border rounded-lg overflow-hidden shrink-0">
                    {(['EN', 'KO'] as const).map((l) => (
                        <button
                            key={l}
                            onClick={() => setLang(l)}
                            className={`px-4 py-1.5 text-sm font-bold transition-colors ${
                                lang === l
                                    ? 'bg-wing-text text-wing-bg'
                                    : 'bg-wing-card text-wing-muted hover:text-wing-text'
                            }`}
                        >
                            {l}
                        </button>
                    ))}
                </div>
            </div>

            <HistoryTab lang={lang} />
        </div>
    );
}
