/**
 * Types and constants for DependencyMap component.
 */

import type { Language } from '@/lib/compliance-i18n'

export interface Requirement {
  id: string
  article: string
  title: string
  regulation_code: string
}

export interface Control {
  id: string
  control_id: string
  title: string
  domain: string
  status: string
}

export interface Mapping {
  requirement_id: string
  control_id: string
  coverage_level: 'full' | 'partial' | 'planned'
}

export interface DependencyMapProps {
  requirements: Requirement[]
  controls: Control[]
  mappings: Mapping[]
  lang?: Language
  onControlClick?: (control: Control) => void
  onRequirementClick?: (requirement: Requirement) => void
}

export const DOMAIN_COLORS: Record<string, string> = {
  gov: '#64748b',
  priv: '#3b82f6',
  iam: '#a855f7',
  crypto: '#eab308',
  sdlc: '#22c55e',
  ops: '#f97316',
  ai: '#ec4899',
  cra: '#06b6d4',
  aud: '#6366f1',
}

export const DOMAIN_LABELS: Record<string, string> = {
  gov: 'Governance',
  priv: 'Datenschutz',
  iam: 'Identity & Access',
  crypto: 'Kryptografie',
  sdlc: 'Secure Dev',
  ops: 'Operations',
  ai: 'KI-spezifisch',
  cra: 'Supply Chain',
  aud: 'Audit',
}

export const COVERAGE_COLORS: Record<string, { bg: string; border: string; text: string }> = {
  full: { bg: 'bg-green-100', border: 'border-green-500', text: 'text-green-700' },
  partial: { bg: 'bg-yellow-100', border: 'border-yellow-500', text: 'text-yellow-700' },
  planned: { bg: 'bg-slate-100', border: 'border-slate-400', text: 'text-slate-600' },
}
