You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
603 B
TypeScript
26 lines
603 B
TypeScript
import { Suspense } from "react";
|
|
import { getCurrentUser } from "@/data/auth";
|
|
import { logout } from "@/app/(auth)/actions";
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
export default function DashboardPage() {
|
|
return (
|
|
<main className="p-4">
|
|
<Suspense fallback={<p>Loading...</p>}>
|
|
<Greeting />
|
|
</Suspense>
|
|
<form action={logout}>
|
|
<Button type="submit" variant="destructive">
|
|
Keluar
|
|
</Button>
|
|
</form>
|
|
</main>
|
|
);
|
|
}
|
|
|
|
async function Greeting() {
|
|
const user = await getCurrentUser();
|
|
|
|
return <div>Halo, {user.name}!</div>;
|
|
}
|