1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-11-26 02:04:17 +00:00
todocolors/todoblue/src/app/CreatePublicBoardPanel.tsx

58 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-08-02 02:14:49 +00:00
"use client"
import {useBoardCreator} from "@/app/useBoardCreator"
import {useLowerKebabState} from "@/app/useKebabState"
import {faGlobe} from "@fortawesome/free-solid-svg-icons"
import {default as React} from "react"
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
export function CreatePublicBoardPanel() {
2023-08-02 02:14:49 +00:00
const [code, setCode] = useLowerKebabState("")
const {createBoard} = useBoardCreator();
return (
<form
className={"panel box form-flex"}
onSubmit={e => {
e.preventDefault();
createBoard(code);
}}
>
<h3>
<FontAwesomeIcon icon={faGlobe}/>
{" "}
Pubblico
</h3>
<p>
Crea un nuovo tabellone pubblico, con un codice personalizzato!
<br/>
<small>Se un tabellone con quel codice esiste già, sarai reindirizzato ad esso.</small>
</p>
<label className={"float-bottom"}>
<span>
Codice
</span>
<input
type={"text"}
placeholder={"garasauto-planning-2023"}
value={code}
onChange={(
e => setCode(e.target.value)
)}
/>
<span/>
</label>
<label>
<span/>
<button
onClick={_ => createBoard(code)}
>
Crea
</button>
<span/>
</label>
</form>
)
}