()
| 4 | import { getImageUrlForShip, getShip } from './utils.tsx' |
| 5 | |
| 6 | function App() { |
| 7 | const [count, setCount] = useState(0) |
| 8 | const [shipName, setShipName] = useState('Dreadnought') |
| 9 | |
| 10 | function handleShipSelection(newShipName: string) { |
| 11 | setShipName(newShipName) |
| 12 | } |
| 13 | |
| 14 | return ( |
| 15 | <div className="app-wrapper"> |
| 16 | <button onClick={() => setCount((c) => c + 1)}> |
| 17 | Click to re-render: {count} |
| 18 | </button> |
| 19 | <ShipButtons shipName={shipName} onShipSelect={handleShipSelection} /> |
| 20 | <div className="app"> |
| 21 | <div className="details"> |
| 22 | <ErrorBoundary fallback={<ShipError shipName={shipName} />}> |
| 23 | <Suspense fallback={<ShipFallback shipName={shipName} />}> |
| 24 | <ShipDetails shipName={shipName} /> |
| 25 | </Suspense> |
| 26 | </ErrorBoundary> |
| 27 | </div> |
| 28 | </div> |
| 29 | </div> |
| 30 | ) |
| 31 | } |
| 32 | |
| 33 | function ShipButtons({ |
| 34 | shipName, |
nothing calls this directly
no outgoing calls
no test coverage detected