All files / src/constants uiConstants.ts

100% Statements 13/13
100% Branches 6/6
100% Functions 3/3
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121              40x                                   40x                     40x                 40x                                           124x                   15x     15x   15x                   23x     23x   23x           40x                     40x            
import { CIAComponentType } from "../types/cia-services";
 
/**
 * UI-related constants for the application
 */
 
// Widget icons using emoji characters
export const WIDGET_ICONS = {
  SECURITY_LEVEL: "đŸ›Ąī¸",
  SECURITY_SUMMARY: "📊",
  SECURITY_VISUALIZATION: "📈",
  COMPLIANCE_STATUS: "✅",
  VALUE_CREATION: "💹",
  COST_ESTIMATION: "💰",
  BUSINESS_IMPACT: "đŸĸ",
  TECHNICAL_IMPLEMENTATION: "âš™ī¸",
  AVAILABILITY_IMPACT: "âąī¸",
  INTEGRITY_IMPACT: "🔐",
  CONFIDENTIALITY_IMPACT: "🔒",
  SECURITY_RESOURCES: "📚",
};
 
/**
 * Icons for business impact categories
 */
export const BUSINESS_IMPACT_ICONS = {
  financial: "💰",
  operational: "âš™ī¸",
  reputational: "đŸ‘Ĩ",
  regulatory: "📜",
  strategic: "đŸŽ¯",
};
 
/**
 * Icons for CIA components
 */
export const CIA_COMPONENT_ICONS: Record<CIAComponentType, string> = {
  availability: "âąī¸",
  integrity: "✓",
  confidentiality: "🔒",
};
 
/**
 * Icons for security-related concepts
 */
export const SECURITY_ICONS = {
  risk: "âš ī¸",
  recommendation: "💡",
  compliance: "📋",
  riskLevel: "🔍",
  security: "🔐",
  score: "📊",
  details: "â„šī¸",
  implementation: "đŸ› ī¸",
  value: "💎",
  cost: "💲",
  time: "⏰",
  effort: "📈",
};
 
/**
 * Get icon for a specific CIA component
 *
 * @param component - The CIA component
 * @returns The appropriate icon
 */
export function getComponentIcon(component: CIAComponentType): string {
  return CIA_COMPONENT_ICONS[component] || "đŸ”ĩ";
}
 
/**
 * Get icon for a business impact category
 *
 * @param category - The business impact category
 * @returns The appropriate icon
 */
export function getBusinessImpactIcon(category: string): string {
  const normalizedCategory = category.toLowerCase();
 
  // Type assertion to access the object with string index
  const icons = BUSINESS_IMPACT_ICONS as Record<string, string>;
 
  return icons[normalizedCategory] || "📊";
}
 
/**
 * Get icon for a security concept
 *
 * @param concept - The security concept
 * @returns The appropriate icon
 */
export function getSecurityIcon(concept: string): string {
  const normalizedConcept = concept.toLowerCase();
 
  // Type assertion to access the object with string index
  const icons = SECURITY_ICONS as Record<string, string>;
 
  return icons[normalizedConcept] || "🔷";
}
 
/**
 * Color mapping for security levels
 */
export const SECURITY_LEVEL_COLORS = {
  NONE: "#e74c3c", // Red
  LOW: "#f39c12", // Orange
  MODERATE: "#3498db", // Blue
  HIGH: "#2ecc71", // Green
  VERY_HIGH: "#9b59b6", // Purple
};
 
/**
 * UI display limits for compact layouts
 */
export const UI_DISPLAY_LIMITS = {
  /** Maximum number of metrics to display in preview */
  MAX_PREVIEW_METRICS: 4,
  /** Maximum number of gaps to display in compact view */
  MAX_DISPLAYED_GAPS: 3,
};