export interface ProductionLine {
  id: string
  name: string
  description: string
  created_at: string
}

export interface StationDashboard {
  station: {
    id: string
    line_id: string
    project_id: string
    station_type: string
    station_label: string
    sort_order: number
  }
  project_name: string
  machine_type: string
  status: string
  risk_summary: Record<string, number>
  hazard_count: number
  mitigation_count: number
  completeness_pct: number
  sil_max: string
  pl_max: string
}

export interface TransferInfo {
  from_station: number
  to_station: number
  type: string
  label: string
}

export interface LineDashboard {
  line: ProductionLine
  stations: StationDashboard[]
  transfers: TransferInfo[]
  aggregate: Record<string, number>
}

export const STATION_TYPES: Record<string, { label: string; color: string; bgColor: string }> = {
  press: { label: 'Presse', color: '#EF4444', bgColor: 'bg-red-50' },
  robot: { label: 'Roboter', color: '#3B82F6', bgColor: 'bg-blue-50' },
  cobot: { label: 'Cobot', color: '#3B82F6', bgColor: 'bg-blue-50' },
  collaborative_robot: { label: 'Cobot', color: '#3B82F6', bgColor: 'bg-blue-50' },
  conveyor: { label: 'Foerderer', color: '#22C55E', bgColor: 'bg-green-50' },
  assembly: { label: 'Montage', color: '#F97316', bgColor: 'bg-orange-50' },
  milling: { label: 'Fraese', color: '#8B5CF6', bgColor: 'bg-purple-50' },
  turning: { label: 'Drehmaschine', color: '#1D4ED8', bgColor: 'bg-blue-50' },
  welding: { label: 'Schweissen', color: '#EAB308', bgColor: 'bg-yellow-50' },
  inspection: { label: 'Pruefung', color: '#06B6D4', bgColor: 'bg-cyan-50' },
  packaging: { label: 'Verpackung', color: '#92400E', bgColor: 'bg-amber-50' },
  motor: { label: 'Motor', color: '#6B7280', bgColor: 'bg-gray-50' },
  electric_motor: { label: 'Elektromotor', color: '#6B7280', bgColor: 'bg-gray-50' },
  rotary_transfer: { label: 'Rundtakt', color: '#7C3AED', bgColor: 'bg-violet-50' },
  rotary_transfer_machine: { label: 'Rundtakt', color: '#7C3AED', bgColor: 'bg-violet-50' },
}

export const TRANSFER_COLORS: Record<string, string> = {
  conveyor: '#22C55E',
  robot: '#3B82F6',
  manual: '#EAB308',
  crane: '#F97316',
  agv: '#8B5CF6',
}
