export interface ToolStatus {
  name: string
  installed: boolean
  version: string | null
  last_run: string | null
  last_findings: number
}

export interface Finding {
  id: string
  tool: string
  severity: string
  title: string
  message: string | null
  file: string | null
  line: number | null
  found_at: string
}

export interface SeveritySummary {
  critical: number
  high: number
  medium: number
  low: number
  info: number
  total: number
}

export interface HistoryItem {
  timestamp: string
  title: string
  description: string
  status: string
}

export type ScanType = 'secrets' | 'sast' | 'deps' | 'containers' | 'sbom' | 'all'

export interface MonitoringMetric {
  name: string
  value: number
  unit: string
  status: 'ok' | 'warning' | 'critical'
  trend: 'up' | 'down' | 'stable'
}

export interface ActiveAlert {
  id: string
  severity: 'critical' | 'high' | 'medium' | 'low'
  title: string
  source: string
  timestamp: string
  acknowledged: boolean
}

export type TabId = 'overview' | 'findings' | 'tools' | 'history' | 'monitoring'

export const SCAN_TYPE_LABELS: Record<ScanType, string> = {
  secrets: 'Secrets (Gitleaks)',
  sast: 'SAST (Semgrep + Bandit)',
  deps: 'Dependencies (Trivy + Grype)',
  containers: 'Container',
  sbom: 'SBOM (Syft)',
  all: 'Full Scan',
}

export const TOOL_DESCRIPTIONS: Record<string, { icon: string; desc: string }> = {
  gitleaks: { icon: '🔑', desc: 'Secrets Detection in Git History' },
  semgrep: { icon: '🔍', desc: 'Static Application Security Testing (SAST)' },
  bandit: { icon: '🐍', desc: 'Python Security Linter' },
  trivy: { icon: '🔒', desc: 'Container & Filesystem Vulnerability Scanner' },
  grype: { icon: '🐛', desc: 'Vulnerability Scanner for Dependencies' },
  syft: { icon: '📦', desc: 'SBOM Generator (CycloneDX/SPDX)' },
}

export const TOOL_TO_SCAN_TYPE: Record<string, ScanType> = {
  gitleaks: 'secrets',
  semgrep: 'sast',
  bandit: 'sast',
  trivy: 'deps',
  grype: 'deps',
  syft: 'sbom',
}
