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