import React from 'react'; import { getStatus, createGame, gameInfo } from "./services/ggsh.service"; import './App.css'; class InfoComponent extends React.Component { constructor(props) { super(props); this.state = { loading: true, version: null, status: null, } } async componentDidMount() { const { version, status } = await getStatus(); this.setState({loading: false, version, status}); } render() { if (this.state.loading) { return

Connecting to back-end...

} if (this.state.status !== "healthy") { return

Unable to communicate with API server! Error: {this.state.status}

} return

API Version: {this.state.version}

} } const GameInfo = ({game}) => { const { gameId, creator, timer, coords, players } = game; return (

Game ID: {gameId}

Creator: {creator}

Time Limit: {timer}

Coordinates: {JSON.stringify(coords)}

Players: {JSON.stringify(players)}

); } class GameMakerComp extends React.Component { constructor(props) { super(props); this.state = { loading: false, game: null, } } async onClick() { this.setState({loading: true}); const gameId = await createGame("testing", 300); const game = await gameInfo(gameId); this.setState({loading: false, game}); } render() { if (this.state.loading) { return

Loading...

} if (this.state.game) { return
} return
} } const App = () => { return (

TerrAssumptions!



); } export default App;