blob: b78fe38950f9c930e7d1131968c6d512d31c04e2 (
plain) (
blame)
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
|
"use client";
import { useCallback } from "react";
import { LoginButton } from "../components/auth/login";
import { LogoutButton } from "../components/auth/logout";
export default function Home() {
const addUrl = useCallback(async () => {
await fetch("/api/v1/links", {
method: "POST",
body: JSON.stringify({ url: "https://news.ycombinator.com/news" }),
});
}, []);
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div>
<LoginButton />
<br />
<br />
<LogoutButton />
<br />
<br />
<button onClick={addUrl}>Add URL</button>
</div>
</main>
);
}
|