import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import Content from '../components/content'
import Navbar from '../components/navbar'
import TrianglesBG from '../components/trianglesbg'
import Alert from '../components/alert'
import Sticker from '../components/sticker'
import Textbox from '../components/textbox'
import Popsicle from '../components/popsicle'
import { useState } from 'react'
export default function Home() {
let [message, setMessage] = useState('')
let [alert, setAlert] = useState(false)
return (
<>
TheRed.SH / Home
{/* */}
{/* Hello there! I'm a sticker!
This is just a simple demo.
A much more finished website will be coming soon! */}
{
setAlert(false)
let REQUEST = await fetch("/api/submit", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
text: TEXT
})
});
let RESPONSE = await REQUEST.text();
setMessage(RESPONSE);
setAlert(true);
// fetch('/api/logger', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify({
// msg: '[Sent message] Query: '+TEXT+'; Response: '+RESPONSE+'; Request Code: '+REQUEST.status+'; Request Method: POST'
// })
// });
}} />
{
alert &&
{message}
}
>
)
}