Merge branch 'main' of https://github.com/GamerBoss101/HooHacks-12
This commit is contained in:
@@ -12,6 +12,25 @@ const CallPage = () => {
|
|||||||
|
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleEmergency = async () => {
|
||||||
|
// send texts
|
||||||
|
const response = await fetch("/api/sendMessage", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
message: `yo i need help`,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
console.error("Error sending message:", response.statusText);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
|
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
|
||||||
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
|
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
|
||||||
@@ -19,7 +38,7 @@ const CallPage = () => {
|
|||||||
Call with a Definitely Real Person</h1>
|
Call with a Definitely Real Person</h1>
|
||||||
|
|
||||||
<div className="text-2xl font-bold">{callDuration}s</div>
|
<div className="text-2xl font-bold">{callDuration}s</div>
|
||||||
<button className="bg-red-500 text-white rounded-md p-2">Emergency</button>
|
<button onClick={handleEmergency} className="bg-red-500 text-white rounded-md p-2">Emergency</button>
|
||||||
<button className="bg-blue-500 text-white rounded-md p-2"
|
<button className="bg-blue-500 text-white rounded-md p-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.location.href = '/';
|
window.location.href = '/';
|
||||||
|
|||||||
@@ -13,23 +13,6 @@ export default async function Home() {
|
|||||||
|
|
||||||
console.log("Session:", session?.user);
|
console.log("Session:", session?.user);
|
||||||
|
|
||||||
const handleEmergency = async () => {
|
|
||||||
// send texts
|
|
||||||
const response = await fetch("/api/sendMessage", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
message: `yo i need help`,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
console.error("Error sending message:", response.statusText);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no session, show sign-up and login buttons
|
// If no session, show sign-up and login buttons
|
||||||
if (!session) {
|
if (!session) {
|
||||||
|
|||||||
Reference in New Issue
Block a user