feat(scroll-area): add horizontal scrollbar to problem description page

This commit is contained in:
cfngc4594 2025-03-09 15:04:54 +08:00
parent 163dc4b57c
commit dd2f4a733b

View File

@ -1,7 +1,7 @@
import prisma from "@/lib/prisma"; import prisma from "@/lib/prisma";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { ScrollArea } from "@/components/ui/scroll-area";
import { MdxRenderer } from "@/components/content/mdx-renderer"; import { MdxRenderer } from "@/components/content/mdx-renderer";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
interface ProblemPageProps { interface ProblemPageProps {
params: Promise<{ id: string }> params: Promise<{ id: string }>
@ -26,6 +26,7 @@ export default async function ProblemPage({
return ( return (
<ScrollArea className="[&>[data-radix-scroll-area-viewport]]:max-h-[calc(100vh-130px)]"> <ScrollArea className="[&>[data-radix-scroll-area-viewport]]:max-h-[calc(100vh-130px)]">
<MdxRenderer source={problem.description} /> <MdxRenderer source={problem.description} />
<ScrollBar orientation="horizontal" />
</ScrollArea> </ScrollArea>
); );
} }