mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 23:42:24 +00:00
refactor(layout, page, description): update problem page layout and structure, including description fetching and TabsContent styling
This commit is contained in:
parent
c0f72a21dd
commit
4727c55bcc
@ -1,5 +1,5 @@
|
|||||||
import ProblemDescriptionFooter from "@/features/playground/problem/description/footer";
|
|
||||||
import prisma from "@/lib/prisma";
|
import prisma from "@/lib/prisma";
|
||||||
|
import ProblemDescriptionFooter from "@/features/playground/problem/description/footer";
|
||||||
|
|
||||||
interface ProblemDescriptionLayoutProps {
|
interface ProblemDescriptionLayoutProps {
|
||||||
params: Promise<{ id: string }>;
|
params: Promise<{ id: string }>;
|
||||||
|
@ -3,20 +3,20 @@ import { notFound } from "next/navigation";
|
|||||||
import { MdxRenderer } from "@/components/content/mdx-renderer";
|
import { MdxRenderer } from "@/components/content/mdx-renderer";
|
||||||
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
||||||
|
|
||||||
interface ProblemPageProps {
|
interface ProblemDescriptionPageProps {
|
||||||
params: Promise<{ id: string }>
|
params: Promise<{ id: string }>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function ProblemPage({
|
export default async function ProblemDescriptionPage({
|
||||||
params
|
params
|
||||||
}: ProblemPageProps) {
|
}: ProblemDescriptionPageProps) {
|
||||||
const { id } = await params;
|
const { id } = await params;
|
||||||
|
|
||||||
const problem = await prisma.problem.findUnique({
|
const problem = await prisma.problem.findUnique({
|
||||||
where: { id: parseInt(id) },
|
where: { id: parseInt(id) },
|
||||||
include: {
|
select: {
|
||||||
author: true,
|
description: true,
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!problem) {
|
if (!problem) {
|
||||||
|
@ -47,10 +47,10 @@ export default function ProblemLayout({
|
|||||||
<TabsContent value="description" className="h-full mt-0">
|
<TabsContent value="description" className="h-full mt-0">
|
||||||
{description}
|
{description}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
<TabsContent value="solution">
|
<TabsContent value="solution" className="h-full mt-0">
|
||||||
{solution}
|
{solution}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
<TabsContent value="submission">
|
<TabsContent value="submission" className="h-full mt-0">
|
||||||
{submission}
|
{submission}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
Loading…
Reference in New Issue
Block a user