feat(layout): add Suspense with fallback loading for problemset layout

This commit is contained in:
cfngc4594 2025-03-13 11:24:24 +08:00
parent b78547a992
commit 2f037f8a78

View File

@ -1,4 +1,6 @@
import { Suspense } from "react";
import { Banner } from "@/components/banner";
import { Loading } from "@/components/loading";
import { AvatarButton } from "@/components/avatar-button";
interface ProblemsetLayoutProps {
@ -7,13 +9,15 @@ interface ProblemsetLayoutProps {
export default function ProblemsetLayout({ children }: ProblemsetLayoutProps) {
return (
<div className="relative flex flex-col">
<div className="relative h-screen flex flex-col">
<Banner />
<div className="absolute top-2 right-4">
<AvatarButton />
</div>
<main className="container mx-auto p-4">
<main className="h-full container mx-auto p-4">
<Suspense fallback={<Loading />}>
{children}
</Suspense>
</main>
</div>
);