'use client'; import { useMemo } from 'react'; import type { BeadIssue } from '../../lib/types'; import type { ProjectScopeOption } from '../../lib/project-scope'; import { TopBar } from './top-bar'; import { LeftPanel } from './left-panel'; import { RightPanel } from './right-panel'; import { MobileNav } from './mobile-nav'; import { useUrlState } from '../../hooks/use-url-state'; import { GraphView } from '../graph/graph-view'; import { SocialPage } from '../social/social-page'; import { SocialDetail } from '../social/social-detail'; import { SwarmPage } from '../swarm/swarm-page'; import { SwarmDetail } from '../swarm/swarm-detail'; import { buildSocialCards } from '../../lib/social-cards'; import { buildSwarmCards } from '../../lib/swarm-cards'; export interface UnifiedShellProps { issues: BeadIssue[]; projectRoot: string; projectScopeKey: string; projectScopeOptions: ProjectScopeOption[]; projectScopeMode: 'single' | 'aggregate'; } export function UnifiedShell({ issues, }: UnifiedShellProps) { const { view, taskId, setTaskId, swarmId, setSwarmId, graphTab, setGraphTab, panel } = useUrlState(); const socialCards = useMemo(() => buildSocialCards(issues), [issues]); const swarmCards = useMemo(() => buildSwarmCards(issues), [issues]); const selectedSocialCard = taskId ? socialCards.find(c => c.id === taskId) : null; const selectedSwarmCard = swarmId ? swarmCards.find(c => c.swarmId === swarmId) : null; const handleGraphSelect = (id: string) => { setTaskId(id); }; const renderRightPanel = () => { if (view === 'social' && taskId && selectedSocialCard) { return ; } if (view === 'swarm' && swarmId && selectedSwarmCard) { return ; } return null; }; const renderMiddleContent = () => { if (view === 'graph') { return ( ); } if (view === 'social') { return ( ); } if (view === 'swarm') { return ( ); } return null; }; return (
{/* TOP BAR: 3rem fixed */} {/* MAIN AREA: CSS Grid [13rem | 1fr | 17rem] */}
{/* LEFT PANEL: 13rem channel tree */} {/* MIDDLE CONTENT: flex-1 */}
{renderMiddleContent()}
{/* RIGHT PANEL: 17rem detail strip */} {renderRightPanel()}
{/* MOBILE NAV: Bottom tab bar */}
); }