Add region security and coloring

Add security field to region data and implement color-coding.
This commit is contained in:
gpt-engineer-app[bot]
2025-06-13 23:50:02 +00:00
parent 81bfc9f45a
commit 4fa2c3b106
3 changed files with 10 additions and 6 deletions

View File

@@ -1,4 +1,3 @@
import React, { useState } from 'react';
import { getSecurityColor } from '../utils/securityColors';
@@ -25,12 +24,10 @@ export const MapNode: React.FC<MapNodeProps> = ({
}) => {
const [isHovered, setIsHovered] = useState(false);
// Use security-based color for systems, default colors for regions
const nodeColor = type === 'system' && security !== undefined
// Use security-based color for both systems and regions
const nodeColor = security !== undefined
? getSecurityColor(security)
: type === 'region'
? (isHovered ? '#8b5cf6' : '#a855f7')
: (isHovered ? '#06b6d4' : '#0891b2');
: '#a855f7'; // fallback purple color
if (type === 'region') {
// Render region as a pill/rounded rectangle