33 lines
920 B
TypeScript
33 lines
920 B
TypeScript
import NumericStepper from '../ui/NumericStepper';
|
|
import type { Ship } from '../../types/ship';
|
|
|
|
interface Props {
|
|
ship: Ship;
|
|
onUpdate: (patch: Partial<Ship>) => void;
|
|
}
|
|
|
|
export default function VitalsSection({ ship, onUpdate }: Props) {
|
|
return (
|
|
<section className="dashboard-section">
|
|
<div className="combat-stats">
|
|
<div className="combat-stat">
|
|
<NumericStepper
|
|
label={`Hull (max ${ship.hull_max})`}
|
|
value={ship.hull_current}
|
|
max={ship.hull_max}
|
|
onChange={(v) => onUpdate({ hull_current: v })}
|
|
/>
|
|
</div>
|
|
<div className="combat-stat">
|
|
<NumericStepper
|
|
label={`Armor (max ${ship.armor_max})`}
|
|
value={ship.armor_current}
|
|
max={ship.armor_max}
|
|
onChange={(v) => onUpdate({ armor_current: v })}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|