From f03cd13d8717ac83a5cc6fb6f56ead0c84858840 Mon Sep 17 00:00:00 2001 From: zenchantlive Date: Fri, 20 Feb 2026 17:13:12 -0800 Subject: [PATCH] feat(swarm): implement swarm workspace container component --- src/components/swarm/swarm-workspace.tsx | 47 +++++++++++++++++++ .../components/swarm/swarm-workspace.test.tsx | 10 ++++ 2 files changed, 57 insertions(+) create mode 100644 src/components/swarm/swarm-workspace.tsx create mode 100644 tests/components/swarm/swarm-workspace.test.tsx diff --git a/src/components/swarm/swarm-workspace.tsx b/src/components/swarm/swarm-workspace.tsx new file mode 100644 index 0000000..07887d9 --- /dev/null +++ b/src/components/swarm/swarm-workspace.tsx @@ -0,0 +1,47 @@ +"use client"; + +import React, { useState } from 'react'; + +export function SwarmWorkspace({ selectedMissionId }: { selectedMissionId?: string }) { + const [activeTab, setActiveTab] = useState<'operations' | 'archetypes' | 'templates'>('operations'); + + const renderTabContent = () => { + switch (activeTab) { + case 'operations': + return selectedMissionId + ?
Ops Details for {selectedMissionId}
+ :
Select a mission from the left panel.
; + case 'archetypes': + return
Archetypes UI
; + case 'templates': + return
Templates UI
; + default: + return null; + } + }; + + return ( +
+ {/* Tab Navigation - Min 44px for mobile targets */} +
+ {['operations', 'archetypes', 'templates'].map(tab => ( + + ))} +
+ + {/* Content Area */} +
+ {renderTabContent()} +
+
+ ); +} diff --git a/tests/components/swarm/swarm-workspace.test.tsx b/tests/components/swarm/swarm-workspace.test.tsx new file mode 100644 index 0000000..1eac3d0 --- /dev/null +++ b/tests/components/swarm/swarm-workspace.test.tsx @@ -0,0 +1,10 @@ +import { expect, test, describe } from 'bun:test'; + +describe('SwarmWorkspace Component', () => { + test('exports SwarmWorkspace component that is a function', async () => { + // This will fail because the file doesn't exist yet + const mod = await import('../../../src/components/swarm/swarm-workspace'); + expect(mod.SwarmWorkspace).toBeDefined(); + expect(typeof mod.SwarmWorkspace).toBe('function'); + }); +});