diff --git a/src/components/sections/GlobalOperations.tsx b/src/components/sections/GlobalOperations.tsx index 86ccad1..93ece24 100644 --- a/src/components/sections/GlobalOperations.tsx +++ b/src/components/sections/GlobalOperations.tsx @@ -13,6 +13,10 @@ import { useTranslations } from "next-intl"; const RADIUS = 2; const CAM_FOV = 50; +function nodeToSlug(title: string): string { + return title.toLowerCase().trim().replace(/[^\w\s-]/g, '').replace(/[\s_-]+/g, '-').replace(/^-+|-+$/g, ''); +} + function latLonToVec3(lat: number, lon: number, r: number) { const phi = (90 - lat) * (Math.PI / 180); const theta = (lon + 180) * (Math.PI / 180); @@ -436,6 +440,7 @@ function NodeCard({ node, isDark, onClose, onViewCase }: { }) { const isEvent = node.nodeType === "event"; const isHQ = node.nodeType === "hq"; + const nodeSlug = nodeToSlug(node.title); const accent = isHQ ? (isDark ? "#FFFFFF" : "#111111") : isEvent ? (isDark ? "#E879F9" : "#9333EA") : (isDark ? "#38BDF8" : "#0066CC"); @@ -460,7 +465,7 @@ function NodeCard({ node, isDark, onClose, onViewCase }: {