refactor(layout, page, description): update problem page layout and structure, including description fetching and TabsContent styling

This commit is contained in:
cfngc4594 2025-03-10 20:51:21 +08:00
parent c0f72a21dd
commit 4727c55bcc
3 changed files with 9 additions and 9 deletions

View File

@ -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 }>;

View File

@ -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) {

View File

@ -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>