Deskripsi:
- Create validasi
- Create register
- create global prisma, color tune,dan global state
This commit is contained in:
2023-10-02 22:13:08 +08:00
parent 193dc27e9c
commit cf6aaf500e
32 changed files with 1094 additions and 97 deletions

View File

@@ -1,11 +1,30 @@
"use client";
import { Title } from "@mantine/core";
import { Text, Title } from "@mantine/core";
import { Logout } from "../auth";
import { useState } from "react";
import { ApiHipmi } from "@/app/lib/api";
import { useShallowEffect } from "@mantine/hooks";
export default function HomeView() {
const [token, setToken] = useState<any | null>(null);
useShallowEffect(() => {
userToken();
}, []);
async function userToken() {
await fetch(ApiHipmi.get_token)
.then((res) => res.json())
.then((val) => setToken(val));
}
return (
<>
{/* <pre>{JSON.stringify(token, null, 2)}</pre> */}
<Title>Home</Title>
<Text>Welcome, {token?.username}</Text>
<Logout />
</>
);
}