({
shipName,
onShipSelect,
}: {
shipName: string
onShipSelect: (shipName: string) => void
})
| 31 | } |
| 32 | |
| 33 | function ShipButtons({ |
| 34 | shipName, |
| 35 | onShipSelect, |
| 36 | }: { |
| 37 | shipName: string |
| 38 | onShipSelect: (shipName: string) => void |
| 39 | }) { |
| 40 | const ships = ['Dreadnought', 'Interceptor', 'Galaxy Cruiser'] |
| 41 | |
| 42 | return ( |
| 43 | <div className="ship-buttons"> |
| 44 | {ships.map((ship) => ( |
| 45 | <button |
| 46 | key={ship} |
| 47 | onClick={() => onShipSelect(ship)} |
| 48 | className={shipName === ship ? 'active' : ''} |
| 49 | > |
| 50 | {ship} |
| 51 | </button> |
| 52 | ))} |
| 53 | </div> |
| 54 | ) |
| 55 | } |
| 56 | |
| 57 | function ShipDetails({ shipName }: { shipName: string }) { |
| 58 | const ship = use(getShip(shipName)) |
nothing calls this directly
no outgoing calls
no test coverage detected