feat(web): implement weapons section with add/edit/detail modals and notes
Adds WeaponCard with inline ammo stepper and status dropdown, AddWeaponModal, WeaponDetailModal with full editing, and debounced NotesSection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,12 +4,14 @@ import TopBar from '../components/layout/TopBar';
|
||||
import PageContainer from '../components/layout/PageContainer';
|
||||
import VitalsSection from '../components/dashboard/VitalsSection';
|
||||
import MobilitySection from '../components/dashboard/MobilitySection';
|
||||
import WeaponsSection from '../components/dashboard/WeaponsSection';
|
||||
import NotesSection from '../components/dashboard/NotesSection';
|
||||
import { useShipStore } from '../store/use-ship-store';
|
||||
import type { Ship } from '../types/ship';
|
||||
|
||||
export default function ShipDashboardPage() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const { ship, loading, joinShip, leaveShip, updateShip } = useShipStore();
|
||||
const { ship, weapons, loading, joinShip, leaveShip, updateShip, createWeapon, updateWeapon, deleteWeapon } = useShipStore();
|
||||
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -45,7 +47,13 @@ export default function ShipDashboardPage() {
|
||||
<PageContainer>
|
||||
<VitalsSection ship={ship} onUpdate={handleUpdate} />
|
||||
<MobilitySection ship={ship} onUpdate={handleUpdate} />
|
||||
{/* Weapons and Notes sections will be added next */}
|
||||
<WeaponsSection
|
||||
weapons={weapons}
|
||||
onCreateWeapon={createWeapon}
|
||||
onUpdateWeapon={updateWeapon}
|
||||
onDeleteWeapon={deleteWeapon}
|
||||
/>
|
||||
<NotesSection notes={ship.notes} onUpdate={handleUpdate} />
|
||||
</PageContainer>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user