'use client' import React from 'react' import { CheckCircle, Circle, Shield, AlertTriangle, Key, Megaphone, MessageSquare, CreditCard, Bot, User, Mail, Activity, MapPin, Smartphone, BarChart3, Share2, Heart, Briefcase, FileText, FileCode, X, } from 'lucide-react' import { DataPointCategory, RiskLevel, LegalBasis, SupportedLanguage, RISK_LEVEL_STYLING, LEGAL_BASIS_INFO, ARTICLE_9_WARNING, EMPLOYEE_DATA_WARNING, AI_DATA_WARNING, } from '@/lib/sdk/einwilligungen/types' // ============================================================================= // CategoryIcon // ============================================================================= export const CategoryIcon: React.FC<{ category: DataPointCategory; className?: string }> = ({ category, className = 'w-5 h-5', }) => { const icons: Record = { MASTER_DATA: , CONTACT_DATA: , AUTHENTICATION: , CONSENT: , COMMUNICATION: , PAYMENT: , USAGE_DATA: , LOCATION: , DEVICE_DATA: , MARKETING: , ANALYTICS: , SOCIAL_MEDIA: , HEALTH_DATA: , EMPLOYEE_DATA: , CONTRACT_DATA: , LOG_DATA: , AI_DATA: , SECURITY: , } return <>{icons[category] || } } // ============================================================================= // RiskBadge // ============================================================================= export const RiskBadge: React.FC<{ level: RiskLevel; language: SupportedLanguage }> = ({ level, language, }) => { const styling = RISK_LEVEL_STYLING[level] return ( {styling.label[language]} ) } // ============================================================================= // LegalBasisBadge // ============================================================================= export const LegalBasisBadge: React.FC<{ basis: LegalBasis; language: SupportedLanguage }> = ({ basis, language, }) => { const info = LEGAL_BASIS_INFO[basis] const colors: Record = { CONTRACT: 'bg-blue-100 text-blue-700', CONSENT: 'bg-purple-100 text-purple-700', EXPLICIT_CONSENT: 'bg-rose-100 text-rose-700', LEGITIMATE_INTEREST: 'bg-amber-100 text-amber-700', LEGAL_OBLIGATION: 'bg-slate-100 text-slate-700', VITAL_INTERESTS: 'bg-emerald-100 text-emerald-700', PUBLIC_INTEREST: 'bg-cyan-100 text-cyan-700', } return ( {info?.name[language] || basis} ) } // ============================================================================= // SpecialCategoryWarning // ============================================================================= export const SpecialCategoryWarning: React.FC<{ category: DataPointCategory language: SupportedLanguage onClose?: () => void }> = ({ category, language, onClose }) => { let warning = null let bgColor = '' let borderColor = '' let iconColor = '' if (category === 'HEALTH_DATA') { warning = ARTICLE_9_WARNING bgColor = 'bg-rose-50' borderColor = 'border-rose-200' iconColor = 'text-rose-600' } else if (category === 'EMPLOYEE_DATA') { warning = EMPLOYEE_DATA_WARNING bgColor = 'bg-orange-50' borderColor = 'border-orange-200' iconColor = 'text-orange-600' } else if (category === 'AI_DATA') { warning = AI_DATA_WARNING bgColor = 'bg-fuchsia-50' borderColor = 'border-fuchsia-200' iconColor = 'text-fuchsia-600' } if (!warning) return null return (

{warning.title[language]}

{onClose && ( )}

{warning.description[language]}

    {warning.requirements.map((req, idx) => (
  • {req[language]}
  • ))}
) } // ============================================================================= // Article9Badge // ============================================================================= export const Article9Badge: React.FC<{ language: SupportedLanguage }> = ({ language }) => ( {language === 'de' ? 'Art. 9 DSGVO' : 'Art. 9 GDPR'} )