Files
AIHostingTycoon/apps/web/src/components/layout/MainLayout.tsx
T
josh 9a48c188ad Add complete game loop: training, revenue, market, offline catch-up
- Model training system: training jobs produce TrainedModels with
  calculated capabilities based on compute, data, and research
- Market system: organic API demand and consumer subscriptions now
  generate real revenue from deployed models
- Talent system: salary costs calculated from department headcount
- Toast notification system for game events (training complete, etc.)
- Offline catch-up: progress bar + summary screen when returning
- Market page: pricing controls for API and subscription products
- Finance page: income statement, cash charts, funding history
- Tick processor now runs all 7 systems in correct dependency order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-24 17:02:58 -04:00

51 lines
1.6 KiB
TypeScript

import { Sidebar } from './Sidebar';
import { TopBar } from './TopBar';
import { ToastContainer } from '@/components/common/ToastContainer';
import { useGameStore } from '@/store';
import { DashboardPage } from '@/pages/DashboardPage';
import { InfrastructurePage } from '@/pages/InfrastructurePage';
import { ModelsPage } from '@/pages/ModelsPage';
import { SettingsPage } from '@/pages/SettingsPage';
import { MarketPage } from '@/pages/MarketPage';
import { FinancePage } from '@/pages/FinancePage';
export function MainLayout() {
const activePage = useGameStore((s) => s.activePage);
return (
<div className="flex h-screen overflow-hidden">
<Sidebar />
<div className="flex-1 flex flex-col overflow-hidden">
<TopBar />
<main className="flex-1 overflow-y-auto p-6">
<PageRouter page={activePage} />
</main>
</div>
<ToastContainer />
</div>
);
}
function PageRouter({ page }: { page: string }) {
switch (page) {
case 'dashboard': return <DashboardPage />;
case 'infrastructure': return <InfrastructurePage />;
case 'models': return <ModelsPage />;
case 'market': return <MarketPage />;
case 'finance': return <FinancePage />;
case 'settings': return <SettingsPage />;
default: return <PlaceholderPage name={page} />;
}
}
function PlaceholderPage({ name }: { name: string }) {
return (
<div className="flex items-center justify-center h-full text-surface-500">
<div className="text-center">
<h2 className="text-2xl font-bold capitalize mb-2">{name}</h2>
<p className="text-sm">Coming soon...</p>
</div>
</div>
);
}