/**
 * Approval Components
 * ===================
 * HITL (Human-in-the-Loop) 授權組件
 */

export {
  ApprovalCard,
  LongPressButton,
  type ApprovalCardProps,
  type RiskLevel,
  type BlastRadius,
  type DryRunCheck,
  type Signature,
} from './approval-card'

// Re-export ApprovalRequest as both type and value for mock data
import type { ApprovalRequest } from './approval-card'
export type { ApprovalRequest }

export { LiveApprovalPanel } from './live-approval-panel'

// Phase 11: 對話式 AI UI
export { ConversationalView } from './conversational-view'
export { ApprovalThreadItem } from './approval-thread-item'
export { BatchModeSelector, type BatchMode } from './batch-mode-selector'

// =============================================================================
// Mock Data for Demo
// =============================================================================

export const MOCK_APPROVAL_HIGH: ApprovalRequest = {
  id: 'apr-001',
  action: 'Delete Pod: nginx-frontend-7d4b8c9f5-xk2m3',
  description: 'Clean up unresponsive frontend Pod, ReplicaSet will auto-rebuild',
  riskLevel: 'high',
  blastRadius: {
    affectedPods: 3,
    estimatedDowntime: '~2 min',
    relatedServices: ['nginx-ingress', 'frontend-svc', 'cdn-cache'],
    dataImpact: 'NONE',
  },
  dryRunChecks: [
    { name: 'RBAC Permission', passed: true, message: 'cluster-admin' },
    { name: 'Syntax Valid', passed: true },
    { name: 'Resource Exists', passed: true, message: 'Pod found' },
    { name: 'Replica Count > 1', passed: true, message: '3 replicas' },
  ],
  requiredSignatures: 2,
  currentSignatures: 1,
  requestedBy: 'OpenClaw',
  requestedAt: '2026-03-20 14:32:05',
}

export const MOCK_APPROVAL_CRITICAL: ApprovalRequest = {
  id: 'apr-002',
  action: 'DROP TABLE: user_sessions',
  description: 'Clear all user sessions, will force logout all users',
  riskLevel: 'critical',
  blastRadius: {
    affectedPods: 0,
    estimatedDowntime: '0',
    relatedServices: ['auth-service', 'api-gateway', 'user-service'],
    dataImpact: 'DESTRUCTIVE',
  },
  dryRunChecks: [
    { name: 'RBAC Permission', passed: true, message: 'db-admin' },
    { name: 'Syntax Valid', passed: true },
    { name: 'Table Exists', passed: true },
    { name: 'Backup Available', passed: false, message: 'No recent backup!' },
  ],
  requiredSignatures: 2,
  currentSignatures: 2,
  requestedBy: 'OpenClaw',
  requestedAt: '2026-03-20 14:45:12',
}

export const MOCK_APPROVAL_LOW: ApprovalRequest = {
  id: 'apr-003',
  action: 'Scale Deployment: api-backend',
  description: 'Scale from 3 to 5 replicas for increased traffic',
  riskLevel: 'low',
  blastRadius: {
    affectedPods: 5,
    estimatedDowntime: '0',
    relatedServices: ['api-backend'],
    dataImpact: 'NONE',
  },
  dryRunChecks: [
    { name: 'RBAC Permission', passed: true, message: 'deployment-admin' },
    { name: 'Syntax Valid', passed: true },
    { name: 'Resource Quota', passed: true, message: '5/20 pods' },
  ],
  requiredSignatures: 1,
  currentSignatures: 1,
  requestedBy: 'OpenClaw',
  requestedAt: '2026-03-20 15:00:00',
}
