-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
924a085
commit b53f259
Showing
4 changed files
with
53 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,45 @@ | ||
import "./styles/App.css" | ||
import "./styles/theme.css" | ||
import 'bootstrap/dist/css/bootstrap.min.css' | ||
|
||
import { useState } from "react" | ||
import { Button, Row, Form } from 'react-bootstrap' | ||
import { HttpMethod } from "@data/enums" | ||
import Fetch from "@API/Fetch" | ||
|
||
export default function App() { | ||
|
||
var [predict, setPredict] = useState(0) | ||
|
||
async function getPredict() { | ||
var data = await Fetch({ action: `api/predict/`, method: HttpMethod.GET }) | ||
|
||
if (data && data.ok) { | ||
console.log(data) | ||
setPredict(data.predict) | ||
} | ||
setPredict(Math.random()) | ||
} | ||
|
||
return ( | ||
<div className="App"> | ||
Hello | ||
<br /> | ||
<h2>Сгенерить предикт на следующий день</h2> | ||
<br /> | ||
|
||
<Form.Control type="date" /> | ||
|
||
<br /> | ||
|
||
<Button onClick={getPredict}>клик</Button> | ||
|
||
<br /> | ||
<br /> | ||
|
||
{predict > 0 && | ||
<Row className="Row green text-large"> | ||
{predict} | ||
</Row> | ||
} | ||
</div> | ||
) | ||
|
||
} |
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
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
This file was deleted.
Oops, something went wrong.