mirror of
https://github.com/Noratrieb/mx-3.git
synced 2026-01-14 23:35:05 +01:00
not inital commit
This commit is contained in:
parent
3fb040df54
commit
0cd2146f3d
8 changed files with 3369 additions and 10 deletions
28
src/App.tsx
28
src/App.tsx
|
|
@ -1,10 +1,32 @@
|
|||
import React from 'react';
|
||||
import {Container} from "react-bootstrap";
|
||||
import React, { useRef, useState } from "react";
|
||||
import { Button, CardGroup, Container, FormControl, FormGroup, FormLabel, Row } from "react-bootstrap";
|
||||
import client from "./ApiClient";
|
||||
|
||||
function App() {
|
||||
const searchRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const [bands, setBands] = useState<any[]>([]);
|
||||
|
||||
const search = () => {
|
||||
const input = searchRef.current?.value;
|
||||
if (!input) {
|
||||
return;
|
||||
}
|
||||
client.searchBand(input).then((res) => setBands(res.bands));
|
||||
};
|
||||
|
||||
return (
|
||||
<Container>
|
||||
hi
|
||||
<Row>
|
||||
<FormGroup>
|
||||
<FormLabel>Search Band</FormLabel>
|
||||
<FormControl name="searchBand" type="text" ref={searchRef} />
|
||||
</FormGroup>
|
||||
<Button onClick={search}>Search</Button>
|
||||
</Row>
|
||||
<Row>
|
||||
<CardGroup>{bands && bands.map((band) => <div>{band}</div>)}</CardGroup>
|
||||
</Row>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue