/**
 * Unified UI Text Constants
 * 统一的 UI 文本常量
 * 
 * 目的：确保整个前端应用的文本具有严格的一致性
 * Purpose: Ensure strict consistency of text across the entire frontend application
 */

// ============================================
// Button Text
// ============================================
export const ButtonText = {
  // Common Actions
  SAVE: "Save",
  CANCEL: "Cancel",
  DELETE: "Delete",
  EDIT: "Edit",
  ADD: "Add",
  CREATE: "Create",
  UPDATE: "Update",
  CONFIRM: "Confirm",
  CLOSE: "Close",
  
  // Data Operations
  REFRESH: "Refresh",
  RELOAD: "Reload",
  RETRY: "Retry",
  LOAD_MORE: "Load More",
  
  // Navigation
  BACK: "Back",
  NEXT: "Next",
  GO_TO: "Go to",
  VIEW_DETAILS: "View Details",
  
  // Instance/Deployment
  DEPLOY: "Deploy",
  UPGRADE: "Upgrade",
  ROLLBACK: "Rollback",
  START: "Start",
  STOP: "Stop",
  RESTART: "Restart",
  
  // Test & Verify
  TEST: "Test",
  TEST_CONNECTION: "Test Connection",
  VERIFY: "Verify",
  
  // File & Copy
  COPY: "Copy",
  DOWNLOAD: "Download",
  UPLOAD: "Upload",
  EXPORT: "Export",
  IMPORT: "Import",
} as const;

// ============================================
// Loading State Text
// ============================================
export const LoadingText = {
  // Generic
  LOADING: "Loading...",
  LOADING_DATA: "Loading data...",
  PLEASE_WAIT: "Please wait...",
  
  // Specific Resources
  LOADING_CLUSTERS: "Loading clusters...",
  LOADING_REGISTRIES: "Loading registries...",
  LOADING_INSTANCES: "Loading instances...",
  LOADING_REPOSITORIES: "Loading repositories...",
  LOADING_TAGS: "Loading tags...",
  LOADING_HISTORY: "Loading history...",
  
  // Operations
  SAVING: "Saving...",
  DELETING: "Deleting...",
  DEPLOYING: "Deploying...",
  UPGRADING: "Upgrading...",
  TESTING: "Testing connection...",
  REFRESHING: "Refreshing...",
} as const;

// ============================================
// Empty State Text
// ============================================
export const EmptyText = {
  // Generic
  NO_DATA: "No data available",
  NO_RESULTS: "No results found",
  NO_ITEMS: "No items to display",
  
  // Specific Resources
  NO_CLUSTERS: "No clusters found",
  NO_REGISTRIES: "No registries found",
  NO_INSTANCES: "No instances found",
  NO_REPOSITORIES: "No repositories found",
  NO_TAGS: "No tags found",
  NO_HISTORY: "No deployment history",
  
  // Empty State Descriptions
  NO_CLUSTERS_DESC: "You haven't added any Kubernetes clusters yet. Add a cluster to get started.",
  NO_REGISTRIES_DESC: "You haven't added any OCI registries yet. Add a registry to get started.",
  NO_INSTANCES_DESC: "No application instances are currently deployed.",
  NO_REPOSITORIES_DESC: "This registry doesn't contain any repositories yet.",
} as const;

// ============================================
// Error State Text
// ============================================
export const ErrorText = {
  // Generic
  ERROR_OCCURRED: "An error occurred",
  SOMETHING_WENT_WRONG: "Something went wrong",
  FAILED_TO_LOAD: "Failed to load data",
  
  // Action Prompts
  TRY_AGAIN: "Please try again",
  RETRY_ACTION: "Click Retry to try again",
  REFRESH_PAGE: "Please refresh the page",
  CHECK_CONNECTION: "Please check your connection",
} as const;

// ============================================
// Confirmation Text
// ============================================
export const ConfirmText = {
  // Delete Confirmations
  DELETE_CLUSTER: (name: string) => `Are you sure you want to delete cluster "${name}"? This action cannot be undone.`,
  DELETE_REGISTRY: (name: string) => `Are you sure you want to delete registry "${name}"? This action cannot be undone.`,
  DELETE_INSTANCE: (name: string) => `Are you sure you want to delete instance "${name}"? This action cannot be undone.`,
  
  // Rollback Confirmation
  ROLLBACK_INSTANCE: (revision: number) => `Are you sure you want to rollback to revision ${revision}?`,
  
  // Generic Confirmations
  CONFIRM_ACTION: "Are you sure you want to proceed?",
  CANNOT_UNDO: "This action cannot be undone.",
} as const;

// ============================================
// Status Text
// ============================================
export const StatusText = {
  // Connection Status
  CONNECTED: "Connected",
  DISCONNECTED: "Disconnected",
  CONNECTING: "Connecting...",
  
  // Deployment Status
  DEPLOYED: "Deployed",
  DEPLOYING: "Deploying",
  FAILED: "Failed",
  PENDING: "Pending",
  RUNNING: "Running",
  STOPPED: "Stopped",
  
  // Health Status
  HEALTHY: "Healthy",
  UNHEALTHY: "Unhealthy",
  WARNING: "Warning",
  UNKNOWN: "Unknown",
  
  // Operation Status
  SUCCESS: "Success",
  IN_PROGRESS: "In Progress",
  COMPLETED: "Completed",
  CANCELLED: "Cancelled",
} as const;

// ============================================
// Label Text
// ============================================
export const LabelText = {
  // Form Fields
  NAME: "Name",
  DESCRIPTION: "Description",
  URL: "URL",
  USERNAME: "Username",
  PASSWORD: "Password",
  TOKEN: "Token",
  NAMESPACE: "Namespace",
  VERSION: "Version",
  VALUES: "Values",
  
  // Resource Labels
  CLUSTER: "Cluster",
  CLUSTERS: "Clusters",
  REGISTRY: "Registry",
  REGISTRIES: "Registries",
  INSTANCE: "Instance",
  INSTANCES: "Instances",
  REPOSITORY: "Repository",
  REPOSITORIES: "Repositories",
  TAG: "Tag",
  TAGS: "Tags",
  
  // Info Labels
  CREATED_AT: "Created At",
  UPDATED_AT: "Updated At",
  LAST_DEPLOYED: "Last Deployed",
  REVISION: "Revision",
  STATUS: "Status",
  TYPE: "Type",
  SIZE: "Size",
} as const;

// ============================================
// Placeholder Text
// ============================================
export const PlaceholderText = {
  // Search & Filter
  SEARCH: "Search...",
  FILTER: "Filter...",
  SELECT: "Select...",
  
  // Form Inputs
  ENTER_NAME: "Enter name",
  ENTER_URL: "Enter URL",
  ENTER_DESCRIPTION: "Enter description",
  ENTER_USERNAME: "Enter username",
  ENTER_PASSWORD: "Enter password",
  SELECT_CLUSTER: "Select a cluster",
  SELECT_NAMESPACE: "Select namespace",
} as const;

// ============================================
// Info & Help Text
// ============================================
export const InfoText = {
  // Tips
  TIP: "Tip",
  TIPS: "Tips",
  USAGE_TIPS: "Usage Tips",
  
  // Warnings
  WARNING: "Warning",
  CAUTION: "Caution",
  IMPORTANT: "Important",
  
  // Notes
  NOTE: "Note",
  NOTES: "Notes",
  INFO: "Information",
} as const;

// ============================================
// Export All
// ============================================
export const UIText = {
  Button: ButtonText,
  Loading: LoadingText,
  Empty: EmptyText,
  Error: ErrorText,
  Confirm: ConfirmText,
  Status: StatusText,
  Label: LabelText,
  Placeholder: PlaceholderText,
  Info: InfoText,
} as const;

