import { useEffect } from 'react'; import { useParams } from 'react-router-dom'; import TopBar from '../components/layout/TopBar'; import PageContainer from '../components/layout/PageContainer'; import VitalsSection from '../components/dashboard/VitalsSection'; import ShipStatsSection from '../components/dashboard/ShipStatsSection'; import WeaponsSection from '../components/dashboard/WeaponsSection'; import NotesSection from '../components/dashboard/NotesSection'; import { useShipStore } from '../store/use-ship-store'; export default function ShipDashboardPage() { const { id } = useParams<{ id: string }>(); const { ship, weapons, loading, joinShip, leaveShip, updateShip, createWeapon, updateWeapon, deleteWeapon } = useShipStore(); useEffect(() => { if (id) joinShip(id); return () => leaveShip(); }, [id, joinShip, leaveShip]); if (loading || !ship) { return ( <>

Loading ship data...

); } return ( <> ); }