/
hello.tsx
38 lines (34 loc) · 922 Bytes
/
hello.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// deno-lint-ignore-file no-explicit-any
import React, { useState } from "https://esm.sh/react@18.2.0";
const Hello = () => {
const [link, setLink] = useState("Guest");
const handleChange = (e: any) => {
setLink(e.target.value);
};
return (
<div className="row align-items-center" style={{ height: "100vh" }}>
<div className="mx-auto col-3">
<form
className="row column-gap-2"
action={`/${link}`}
>
<input
className="form-control form-control-md col"
type="text"
placeholder="Hello guest"
aria-label="Guest"
onChange={handleChange}
/>
<button
className="btn btn-primary col-2"
style={{ width: "50px" }}
type="submit"
>
Go
</button>
</form>
</div>
</div>
);
};
export default Hello;