Created
January 5, 2022 06:06
-
-
Save kgravenreuth/2661f1b6afa501a73e0e494666181ca8 to your computer and use it in GitHub Desktop.
Odds Comparison with Sports from Cloudbet Market Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//App.js | |
import "./styles.css"; | |
import React from "react"; | |
import { Locale, getSportsName } from "@cloudbet/market-helper"; | |
const sports = ["soccer", "basketball", "american-football"]; | |
export default function App() { | |
const [sport, setSport] = React.useState(sports[0]); | |
return ( | |
<div className="App"> | |
<div> | |
<label for="sport">Sport</label> | |
<select value={sport} onChange={(e) => setSport(e.target.value)}> | |
{sports.map((s) => ( | |
<option value={s}>{getSportsName(s, Locale.en)}</option> | |
))} | |
</select> | |
</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment