mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(layout): add Suspense with fallback loading for problemset layout
This commit is contained in:
parent
b78547a992
commit
2f037f8a78
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user