OptionalinitialLevels: Partial<SecurityLevelState>Initial security levels (defaults to 'Moderate' for all components)
Security level state and update functions
// Basic usage with defaults
const { levels, setLevel, getLevel } = useSecurityLevelState();
// Update a level
setLevel('availability', 'High');
// Get a level
const currentLevel = getLevel('integrity');
// Initialize with custom levels
const { levels } = useSecurityLevelState({
availability: 'High',
integrity: 'Moderate',
confidentiality: 'Very High'
});
// Reset all levels
resetLevels('Low');
Custom hook for managing CIA triad security levels
Business Perspective
Provides unified state management for security officers to configure organizational security posture across all three CIA components. This centralization ensures consistent security level handling and simplifies state management across the application. 🔒
Technical Perspective
Extracts common security level state management pattern found in 8+ widgets, reducing code duplication by ~20% and ensuring consistent behavior. Uses React hooks best practices with proper memoization for optimal performance.