mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +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 ProblemDescriptionFooter from "@/features/playground/problem/description/footer";
|
||||
|
||||
interface ProblemDescriptionLayoutProps {
|
||||
params: Promise<{ id: string }>;
|
||||
|
@ -3,20 +3,20 @@ import { notFound } from "next/navigation";
|
||||
import { MdxRenderer } from "@/components/content/mdx-renderer";
|
||||
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
||||
|
||||
interface ProblemPageProps {
|
||||
interface ProblemDescriptionPageProps {
|
||||
params: Promise<{ id: string }>
|
||||
}
|
||||
|
||||
export default async function ProblemPage({
|
||||
export default async function ProblemDescriptionPage({
|
||||
params
|
||||
}: ProblemPageProps) {
|
||||
}: ProblemDescriptionPageProps) {
|
||||
const { id } = await params;
|
||||
|
||||
const problem = await prisma.problem.findUnique({
|
||||
where: { id: parseInt(id) },
|
||||
include: {
|
||||
author: true,
|
||||
},
|
||||
select: {
|
||||
description: true,
|
||||
}
|
||||
});
|
||||
|
||||
if (!problem) {
|
||||
|
@ -47,10 +47,10 @@ export default function ProblemLayout({
|
||||
<TabsContent value="description" className="h-full mt-0">
|
||||
{description}
|
||||
</TabsContent>
|
||||
<TabsContent value="solution">
|
||||
<TabsContent value="solution" className="h-full mt-0">
|
||||
{solution}
|
||||
</TabsContent>
|
||||
<TabsContent value="submission">
|
||||
<TabsContent value="submission" className="h-full mt-0">
|
||||
{submission}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
Loading…
Reference in New Issue
Block a user