()
| 32 | ) |
| 33 | |
| 34 | function ShipDetails() { |
| 35 | // 🐨 if there was an error, throw it. |
| 36 | if (!ship) throw shipPromise |
| 37 | |
| 38 | return ( |
| 39 | <div className="ship-info"> |
| 40 | <div className="ship-info__img-wrapper"> |
| 41 | <img |
| 42 | src={getImageUrlForShip(ship.name, { size: 200 })} |
| 43 | alt={ship.name} |
| 44 | /> |
| 45 | </div> |
| 46 | <section> |
| 47 | <h2> |
| 48 | {ship.name} |
| 49 | <sup> |
| 50 | {ship.topSpeed} <small>lyh</small> |
| 51 | </sup> |
| 52 | </h2> |
| 53 | </section> |
| 54 | <section> |
| 55 | {ship.weapons.length ? ( |
| 56 | <ul> |
| 57 | {ship.weapons.map((weapon) => ( |
| 58 | <li key={weapon.name}> |
| 59 | <label>{weapon.name}</label>:{' '} |
| 60 | <span> |
| 61 | {weapon.damage} <small>({weapon.type})</small> |
| 62 | </span> |
| 63 | </li> |
| 64 | ))} |
| 65 | </ul> |
| 66 | ) : ( |
| 67 | <p>NOTE: This ship is not equipped with any weapons.</p> |
| 68 | )} |
| 69 | </section> |
| 70 | <small className="ship-info__fetch-time">{ship.fetchedAt}</small> |
| 71 | </div> |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | function ShipFallback() { |
| 76 | return ( |
nothing calls this directly
no test coverage detected