frontend/app/routes/home.tsx
Nathan Lamy 85e2552db8
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 1m39s
feat: add colle details page
2025-07-29 23:25:10 +02:00

22 lines
695 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import HomePage from "~/components/home";
import UserDropdown from "~/components/user-dropdown";
import { MainLayout } from "~/layout";
import { useUser } from "~/lib/api";
import { forceReload } from "~/lib/utils";
export default function Home() {
const { user, isLoading, error } = useUser();
if (error) {
console.error(error);
// TODO: handle error (redirect to login or show error message)
}
return (
<MainLayout page={<HomePage />}>
<h1 className="text-2xl font-bold" onClick={forceReload}>
Khollis&eacute; - {user.className}
</h1>
{/* TODO: isLoading to display skeleton */}
<UserDropdown user={user} />
</MainLayout>
);
}