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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | 1x 1x 1x 1x 1x 1x 57x 57x 57x 57x 57x 57x 57x 57x 57x 57x 323x 323x | "use client";
import Link from "next/link";
import { useSession } from "next-auth/react";
import { useDemoPersona } from "@/lib/use-demo-persona";
import {
Check,
Network,
BookOpen,
ShieldCheck,
User,
BarChart2,
Layers,
ArrowRightLeft,
FileJson2,
FileText,
LayoutDashboard,
Search,
Handshake,
UserPlus,
MessageSquare,
ClipboardList,
Settings,
Award,
type LucideIcon,
} from "lucide-react";
const IS_STATIC = process.env.NEXT_PUBLIC_STATIC_EXPORT === "true";
/** Routes that are most relevant for each role. */
const ROLE_PATHS: Record<string, string[]> = {
PATIENT: ["/patient", "/graph", "/eehrxf"],
DATA_HOLDER: [
"/graph",
"/catalog",
"/eehrxf",
"/data/share",
"/negotiate",
"/data/transfer",
"/tasks",
"/credentials",
"/settings",
],
DATA_USER: [
"/graph",
"/catalog",
"/analytics",
"/query",
"/data/discover",
"/negotiate",
"/data/transfer",
"/tasks",
"/credentials",
"/settings",
],
HDAB_AUTHORITY: ["/graph", "/compliance", "/credentials"],
EDC_ADMIN: [
"/graph",
"/catalog",
"/patient",
"/analytics",
"/eehrxf",
"/query",
"/data/share",
"/data/discover",
"/negotiate",
"/data/transfer",
"/tasks",
"/compliance",
"/credentials",
"/onboarding",
"/settings",
"/admin",
"/docs",
],
TRUST_CENTER_OPERATOR: ["/graph", "/compliance", "/credentials"],
};
interface FeatureCard {
href: string;
icon: LucideIcon;
label: string;
desc: string;
color: string;
}
const exploreCards: FeatureCard[] = [
{
href: "/graph",
icon: Network,
label: "Graph Explorer",
desc: "Force-directed visualisation of all 5 architecture layers",
color: "border-layer1 hover:bg-layer1/10",
},
{
href: "/catalog",
icon: BookOpen,
label: "Dataset Catalog",
desc: "HealthDCAT-AP metadata for all published datasets",
color: "border-layer2 hover:bg-layer2/10",
},
{
href: "/patient",
icon: User,
label: "Patient Journey",
desc: "FHIR R4 clinical timeline with OMOP CDM mapping",
color: "border-layer3 hover:bg-layer3/10",
},
{
href: "/analytics",
icon: BarChart2,
label: "OMOP Analytics",
desc: "Cohort-level research analytics dashboard",
color: "border-layer4 hover:bg-layer4/10",
},
{
href: "/eehrxf",
icon: Layers,
label: "EEHRxF Profiles",
desc: "EU FHIR profile alignment and EHDS coverage gap analysis",
color: "border-layer2 hover:bg-layer2/10",
},
{
href: "/query",
icon: MessageSquare,
label: "Natural Language Query",
desc: "Federated Cypher queries via natural language interface",
color: "border-layer1 hover:bg-layer1/10",
},
];
const exchangeCards: FeatureCard[] = [
{
href: "/data/share",
icon: ArrowRightLeft,
label: "Share Data",
desc: "Publish and register health data assets for the dataspace",
color: "border-layer1 hover:bg-layer1/10",
},
{
href: "/data/discover",
icon: Search,
label: "Discover Data",
desc: "Search the federated catalog for available datasets",
color: "border-layer2 hover:bg-layer2/10",
},
{
href: "/negotiate",
icon: Handshake,
label: "Contract Negotiation",
desc: "Negotiate data usage contracts with providers via DSP",
color: "border-layer3 hover:bg-layer3/10",
},
{
href: "/data/transfer",
icon: FileJson2,
label: "Data Transfer & FHIR Viewer",
desc: "Transfer FHIR/OMOP data and inspect FHIR R4 bundles",
color: "border-layer4 hover:bg-layer4/10",
},
{
href: "/tasks",
icon: ClipboardList,
label: "EHDS Tasks",
desc: "Track data access permit tasks and approval workflows",
color: "border-layer5 hover:bg-layer5/10",
},
];
const governCards: FeatureCard[] = [
{
href: "/compliance",
icon: ShieldCheck,
label: "Governance & Compliance",
desc: "EHDS compliance, data permits, and protocol conformance testing",
color: "border-layer5 hover:bg-layer5/10",
},
{
href: "/credentials",
icon: Award,
label: "Verifiable Credentials",
desc: "Manage MembershipCredential, EHDS participant, and data permits",
color: "border-layer1 hover:bg-layer1/10",
},
{
href: "/onboarding",
icon: UserPlus,
label: "Onboarding",
desc: "Register new participants and generate DID identities",
color: "border-layer2 hover:bg-layer2/10",
},
{
href: "/settings",
icon: Settings,
label: "Settings",
desc: "Participant profile, connector endpoints, and credentials",
color: "border-layer3 hover:bg-layer3/10",
},
{
href: "/admin",
icon: LayoutDashboard,
label: "Portal Admin",
desc: "Tenant management, policies, component topology, and audit logs",
color: "border-layer4 hover:bg-layer4/10",
},
{
href: "/docs",
icon: FileText,
label: "Documentation",
desc: "User guide, developer docs, and architecture reference",
color: "border-layer3 hover:bg-layer3/10",
},
];
const SECTIONS: Record<string, FeatureCard[]> = {
explore: exploreCards,
exchange: exchangeCards,
govern: governCards,
};
export function FeatureCardGrid({
section,
delay,
}: {
section: "explore" | "exchange" | "govern";
delay: number;
}) {
const { data: session } = useSession();
const demoPersona = useDemoPersona();
const cards = SECTIONS[section];
// Determine active roles
let roles: readonly string[] = [];
Iif (IS_STATIC) {
roles = demoPersona?.roles ?? [];
I} else if (session) {
roles = (session as { roles?: string[] }).roles ?? [];
}
// Build set of highlighted paths
const highlighted = new Set<string>();
for (const role of roles) {
for (const p of ROLE_PATHS[role] ?? []) {
highlighted.add(p);
}
}
const isLoggedIn = IS_STATIC || !!session;
return (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4">
{cards.map(({ href, icon: Icon, label, desc, color }, i) => {
const isRelevant = isLoggedIn && highlighted.has(href);
return (
<Link
key={href}
href={href}
className={`relative border rounded-xl p-4 sm:p-5 transition-colors ${color} animate-fade-in-up ${
isRelevant ? "ring-2 ring-white/20" : ""
}`}
style={{ animationDelay: `${delay + i * 60}ms` }}
>
<div className="flex items-center gap-2 mb-2">
<Icon size={20} aria-hidden="true" />
<span className="font-semibold text-sm sm:text-base text-gray-900 dark:text-gray-100">
{label}
</span>
{isRelevant && (
<span
className="ml-auto flex-shrink-0 w-5 h-5 rounded-full bg-green-500/20 flex items-center justify-center"
title="Relevant for your role"
>
<Check
size={12}
className="text-[var(--success-text)]"
aria-hidden="true"
/>
</span>
)}
</div>
<p className="text-sm text-gray-700 dark:text-gray-300 leading-relaxed">
{desc}
</p>
</Link>
);
})}
</div>
);
}
|