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 { Banner } from "@/components/banner";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
import { AvatarButton } from "@/components/avatar-button";
|
import { AvatarButton } from "@/components/avatar-button";
|
||||||
|
|
||||||
interface ProblemsetLayoutProps {
|
interface ProblemsetLayoutProps {
|
||||||
@ -7,13 +9,15 @@ interface ProblemsetLayoutProps {
|
|||||||
|
|
||||||
export default function ProblemsetLayout({ children }: ProblemsetLayoutProps) {
|
export default function ProblemsetLayout({ children }: ProblemsetLayoutProps) {
|
||||||
return (
|
return (
|
||||||
<div className="relative flex flex-col">
|
<div className="relative h-screen flex flex-col">
|
||||||
<Banner />
|
<Banner />
|
||||||
<div className="absolute top-2 right-4">
|
<div className="absolute top-2 right-4">
|
||||||
<AvatarButton />
|
<AvatarButton />
|
||||||
</div>
|
</div>
|
||||||
<main className="container mx-auto p-4">
|
<main className="h-full container mx-auto p-4">
|
||||||
{children}
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user