import React from "react"; import type { DomainType } from "../engine/shared/types"; import type { ScenarioMeta } from "../scenarios/types"; interface AppHeaderProps { currentDomain: "all" | DomainType; onSelectDomain: (domain: "all" | DomainType) => void; currentScenarioId?: string; scenarios?: readonly { meta: ScenarioMeta }[]; onSelectScenario?: (scenarioId: string) => void; } const DOMAIN_OPTIONS: { id: "all" | DomainType; label: string }[] = [ { id: "all", label: "Tất cả" }, { id: "micro", label: "Kinh tế Vi mô" }, { id: "macro", label: "Kinh tế Vĩ mô" }, { id: "bridge", label: "Cầu nối Vi • Vĩ mô" }, ]; export const AppHeader: React.FC = ({ currentDomain, onSelectDomain, currentScenarioId, scenarios = [], onSelectScenario, }) => { const filteredScenarios = scenarios.filter((s) => { if (currentDomain === "all") return true; if (currentDomain === "bridge") { return ( s.meta.domain === "bridge" || s.meta.id === "micro.consumer.corner_solution" ); } return s.meta.domain === currentDomain; }); return (
{/* Top Banner */}
ES

EconSim • Mô phỏng Kinh tế học Tương tác (FSPPM MPP28)

Nền tảng phân tích thực nghiệm và mô phỏng chính sách công

{/* Domain Filter Pills */}
{DOMAIN_OPTIONS.map((opt) => { const isActive = currentDomain === opt.id; return ( ); })}
{/* Module Selector Pills / Tabs */} {filteredScenarios.length > 0 && (
Chủ đề:
{filteredScenarios.map((sc) => { const isSelected = currentScenarioId === sc.meta.id; return ( ); })}
)}
); };