mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +00:00
feat(layout): add layout with suspense boundary for problem
Some checks failed
Build & Push Judge4c Docker Image / build-and-push-judge4c-docker-image (., Dockerfile, judge4c) (push) Failing after 0s
Some checks failed
Build & Push Judge4c Docker Image / build-and-push-judge4c-docker-image (., Dockerfile, judge4c) (push) Failing after 0s
This commit is contained in:
parent
a7ddd80d09
commit
569beb0b36
16
src/app/(app)/problems/[id]/@Bot/layout.tsx
Normal file
16
src/app/(app)/problems/[id]/@Bot/layout.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
|
|
||||||
|
interface BotLayoutProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function BotLayout({ children }: BotLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col h-full border border-t-0 border-muted rounded-b-3xl bg-background">
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -55,7 +55,7 @@ export default function Bot() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full border border-t-0 border-muted rounded-b-3xl bg-background">
|
<>
|
||||||
<div className="flex-1 relative">
|
<div className="flex-1 relative">
|
||||||
{!messages.some(
|
{!messages.some(
|
||||||
(message) => message.role === "user" || message.role === "assistant"
|
(message) => message.role === "user" || message.role === "assistant"
|
||||||
@ -122,6 +122,6 @@ export default function Bot() {
|
|||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
</form>
|
</form>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
20
src/app/(app)/problems/[id]/@Code/layout.tsx
Normal file
20
src/app/(app)/problems/[id]/@Code/layout.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
|
import { WorkspaceEditorHeader } from "@/components/features/playground/workspace/editor/components/header";
|
||||||
|
import { WorkspaceEditorFooter } from "@/components/features/playground/workspace/editor/components/footer";
|
||||||
|
|
||||||
|
interface CodeLayoutProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function CodeLayout({ children }: CodeLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col h-full">
|
||||||
|
<WorkspaceEditorHeader className="border-b border-x border-muted bg-background" />
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
<WorkspaceEditorFooter />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -1,17 +1,11 @@
|
|||||||
import { ProblemEditor } from "@/components/problem-editor";
|
import { ProblemEditor } from "@/components/problem-editor";
|
||||||
import { WorkspaceEditorHeader } from "@/components/features/playground/workspace/editor/components/header";
|
|
||||||
import { WorkspaceEditorFooter } from "@/components/features/playground/workspace/editor/components/footer";
|
|
||||||
|
|
||||||
export default function CodePage() {
|
export default function CodePage() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full">
|
|
||||||
<WorkspaceEditorHeader className="border-b border-x border-muted bg-background" />
|
|
||||||
<div className="relative flex-1 border-x border-muted">
|
<div className="relative flex-1 border-x border-muted">
|
||||||
<div className="absolute w-full h-full">
|
<div className="absolute w-full h-full">
|
||||||
<ProblemEditor />
|
<ProblemEditor />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<WorkspaceEditorFooter />
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
16
src/app/(app)/problems/[id]/@Description/layout.tsx
Normal file
16
src/app/(app)/problems/[id]/@Description/layout.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
|
|
||||||
|
interface DescriptionLayoutProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DescriptionLayout({ children }: DescriptionLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="h-full flex flex-col">
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -28,7 +28,7 @@ export default async function DescriptionPage({ params }: DescriptionPageProps)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col">
|
<>
|
||||||
<div className="relative flex-1 border-x border-muted">
|
<div className="relative flex-1 border-x border-muted">
|
||||||
<div className="absolute h-full w-full">
|
<div className="absolute h-full w-full">
|
||||||
<ScrollArea className="h-full [&>[data-radix-scroll-area-viewport]>div:min-w-0 [&>[data-radix-scroll-area-viewport]>div]:!block bg-background">
|
<ScrollArea className="h-full [&>[data-radix-scroll-area-viewport]>div:min-w-0 [&>[data-radix-scroll-area-viewport]>div]:!block bg-background">
|
||||||
@ -37,6 +37,6 @@ export default async function DescriptionPage({ params }: DescriptionPageProps)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ProblemDescriptionFooter title={problem.title} />
|
<ProblemDescriptionFooter title={problem.title} />
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
import { getUserLocale } from "@/i18n/locale";
|
import { Suspense } from "react";
|
||||||
import DetailsPage from "@/app/(app)/problems/[id]/@Details/page";
|
import { Loading } from "@/components/loading";
|
||||||
|
|
||||||
export default async function DetailsLayout() {
|
interface DetailsLayoutProps {
|
||||||
const locale = await getUserLocale();
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
return <DetailsPage locale={locale} />;
|
|
||||||
|
export default async function DetailsLayout({ children }: DetailsLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col h-full border border-t-0 border-muted rounded-b-3xl bg-background">
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ export default function DetailsPage({ locale }: DetailsPageProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col border border-t-0 border-muted rounded-b-3xl bg-background">
|
<>
|
||||||
<div className="h-8 flex flex-none items-center px-2 py-1 border-b">
|
<div className="h-8 flex flex-none items-center px-2 py-1 border-b">
|
||||||
<Button
|
<Button
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
@ -206,6 +206,6 @@ export default function DetailsPage({ locale }: DetailsPageProps) {
|
|||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
16
src/app/(app)/problems/[id]/@Solutions/layout.tsx
Normal file
16
src/app/(app)/problems/[id]/@Solutions/layout.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
|
|
||||||
|
interface SolutionsLayoutProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function SolutionsLayout({ children }: SolutionsLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col h-full">
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -28,7 +28,7 @@ export default async function SolutionsPage({ params }: SolutionsPageProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full">
|
<>
|
||||||
<div className="relative flex-1 border-x border-muted">
|
<div className="relative flex-1 border-x border-muted">
|
||||||
<div className="absolute h-full w-full">
|
<div className="absolute h-full w-full">
|
||||||
<ScrollArea className="h-full [&>[data-radix-scroll-area-viewport]>div:min-w-0 [&>[data-radix-scroll-area-viewport]>div]:!block bg-background">
|
<ScrollArea className="h-full [&>[data-radix-scroll-area-viewport]>div:min-w-0 [&>[data-radix-scroll-area-viewport]>div]:!block bg-background">
|
||||||
@ -38,6 +38,6 @@ export default async function SolutionsPage({ params }: SolutionsPageProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ProblemSolutionFooter title={problem.title} />
|
<ProblemSolutionFooter title={problem.title} />
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
16
src/app/(app)/problems/[id]/@Submissions/layout.tsx
Normal file
16
src/app/(app)/problems/[id]/@Submissions/layout.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
|
|
||||||
|
interface SubmissionsLayoutProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function SubmissionsLayout({ children }: SubmissionsLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col h-full px-3 border border-t-0 border-muted rounded-b-3xl bg-background">
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -41,11 +41,11 @@ export default async function SubmissionsPage({ params }: SubmissionsPageProps)
|
|||||||
const locale = await getUserLocale();
|
const locale = await getUserLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="px-3 flex flex-col h-full border border-t-0 border-muted rounded-b-3xl bg-background">
|
<>
|
||||||
<ScrollArea className="h-full">
|
<ScrollArea className="h-full">
|
||||||
<SubmissionsTable locale={locale} submissions={problem.submissions} />
|
<SubmissionsTable locale={locale} submissions={problem.submissions} />
|
||||||
<ScrollBar orientation="horizontal" />
|
<ScrollBar orientation="horizontal" />
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
16
src/app/(app)/problems/[id]/@Testcase/layout.tsx
Normal file
16
src/app/(app)/problems/[id]/@Testcase/layout.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { Loading } from "@/components/loading";
|
||||||
|
|
||||||
|
interface TestcaseLayoutProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function TestcaseLayout({ children }: TestcaseLayoutProps) {
|
||||||
|
return (
|
||||||
|
<div className="relative h-full border border-t-0 border-muted rounded-b-3xl bg-background">
|
||||||
|
<Suspense fallback={<Loading />}>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -30,12 +30,10 @@ export default async function TestcasePage({ params }: TestcasePageProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative h-full border border-t-0 border-muted rounded-b-3xl bg-background">
|
|
||||||
<div className="absolute h-full w-full">
|
<div className="absolute h-full w-full">
|
||||||
<ScrollArea className="h-full">
|
<ScrollArea className="h-full">
|
||||||
<TestcaseCard testcases={problem.testcases} />
|
<TestcaseCard testcases={problem.testcases} />
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user