export interface K8sResource {
  type: string
  name: string
  namespace?: string
  status?: string
  clusterIP?: string
  ports?: string
}

export const NAMESPACE_COLORS: Record<string, string> = {
  default: '#6fb1ff',
  'kube-system': '#9c88ff',
  'kube-public': '#4dd6e8',
  production: '#6fb1ff',
  staging: '#4dd6e8',
  development: '#4dd6e8',
}

export const MOCK_NAMESPACES = [
  { name: 'default', status: 'Active' },
  { name: 'kube-system', status: 'Active' },
  { name: 'kube-public', status: 'Active' },
  { name: 'production', status: 'Active' },
  { name: 'staging', status: 'Active' },
  { name: 'development', status: 'Active' },
]

export const MOCK_PODS: K8sResource[] = [
  { type: 'pod', name: 'nginx-7d9f8', namespace: 'default', status: 'Running' },
  { type: 'pod', name: 'frontend-5a8b2', namespace: 'default', status: 'Running' },
  { type: 'pod', name: 'backend-9c3d4', namespace: 'production', status: 'Running' },
  { type: 'pod', name: 'api-server-2e7f1', namespace: 'production', status: 'Running' },
  { type: 'pod', name: 'worker-4b6c8', namespace: 'production', status: 'Pending' },
  { type: 'pod', name: 'cache-redis-1', namespace: 'staging', status: 'Running' },
  { type: 'pod', name: 'db-postgres-0', namespace: 'staging', status: 'Running' },
  { type: 'pod', name: 'db-postgres-1', namespace: 'staging', status: 'Pending' },
  { type: 'pod', name: 'monitoring-8a2b3', namespace: 'kube-system', status: 'Running' },
  { type: 'pod', name: 'dns-core-5d7e9', namespace: 'kube-system', status: 'Running' },
  { type: 'pod', name: 'log-aggregator-3c4d5', namespace: 'kube-system', status: 'Running' },
  { type: 'pod', name: 'gateway-7f9a2', namespace: 'production', status: 'Running' },
  { type: 'pod', name: 'frontend-dev-1', namespace: 'development', status: 'Running' },
  { type: 'pod', name: 'backend-dev-1', namespace: 'development', status: 'Running' },
  { type: 'pod', name: 'test-runner-6g8h9', namespace: 'default', status: 'Completed' },
]

export const MOCK_DEPLOYMENTS: K8sResource[] = [
  { type: 'deployment', name: 'nginx', namespace: 'default', status: 'Ready' },
  { type: 'deployment', name: 'frontend', namespace: 'default', status: 'Ready' },
  { type: 'deployment', name: 'backend', namespace: 'production', status: 'Ready' },
  { type: 'deployment', name: 'api-server', namespace: 'production', status: 'Ready' },
  { type: 'deployment', name: 'worker', namespace: 'production', status: 'Pending' },
  { type: 'deployment', name: 'redis', namespace: 'staging', status: 'Ready' },
  { type: 'deployment', name: 'postgres', namespace: 'staging', status: 'Ready' },
  { type: 'deployment', name: 'gateway', namespace: 'production', status: 'Ready' },
]

export const MOCK_SERVICES: K8sResource[] = [
  { type: 'service', name: 'nginx-svc', namespace: 'default', clusterIP: '10.96.0.10', ports: '80/TCP' },
  { type: 'service', name: 'frontend-svc', namespace: 'default', clusterIP: '10.96.0.20', ports: '80/TCP' },
  { type: 'service', name: 'backend-svc', namespace: 'production', clusterIP: '10.96.0.30', ports: '8080/TCP' },
  { type: 'service', name: 'api-server-svc', namespace: 'production', clusterIP: '10.96.0.40', ports: '8080/TCP' },
  { type: 'service', name: 'redis-svc', namespace: 'staging', clusterIP: '10.96.0.50', ports: '6379/TCP' },
  { type: 'service', name: 'postgres-svc', namespace: 'staging', clusterIP: '10.96.0.60', ports: '5432/TCP' },
]

export const MOCK_RESOURCES = [
  ...MOCK_NAMESPACES.map(ns => ({
    type: 'namespace' as const,
    name: ns.name,
    status: ns.status,
  })),
  ...MOCK_PODS,
  ...MOCK_DEPLOYMENTS,
  ...MOCK_SERVICES,
]
