refactor(analysis): replace feedback display with MdxPreview component and adjust layout in detail panel

This commit is contained in:
cfngc4594 2026-05-29 14:26:32 +08:00
parent f0ea48ef06
commit 002f1ba681
3 changed files with 14 additions and 11 deletions

View File

@ -20,6 +20,8 @@ import {
import type { AnalysisStatus, CodeAnalysis } from "@/generated/client";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { useTranslations } from "next-intl";
import MdxPreview from "@/components/mdx-preview";
import { MdxComponents } from "@/components/content/mdx-components";
interface AnalysisCardProps {
submissionId: string;
@ -192,12 +194,11 @@ export const AnalysisCard = ({ submissionId }: AnalysisCardProps) => {
</div>
</div>
<div className="text-muted-foreground bg-muted/40 p-4 rounded-lg w-full border">
<h3 className="font-medium mb-2 text-foreground">{t("Feedback")}</h3>
<p className="whitespace-pre-wrap leading-relaxed">
{analysis.feedback}
</p>
</div>
<MdxPreview
source={analysis.feedback ?? t("NotAvailable")}
components={MdxComponents}
className="w-full"
/>
</CardFooter>
</Card>
);

View File

@ -9,7 +9,7 @@ interface DetailContentProps {
export const DetailContent = ({ submissionId }: DetailContentProps) => {
return (
<ScrollArea className="h-full">
<ScrollArea className="min-h-0 flex-1">
<DetailTable submissionId={submissionId} />
<AnalysisContent submissionId={submissionId} />
<ScrollBar orientation="horizontal" />

View File

@ -21,10 +21,12 @@ export const DetailPanel = ({ submissionId }: DetailPanelProps) => {
return (
<PanelLayout isScroll={false}>
<div className="flex h-full min-h-0 flex-col">
<DetailHeader />
<Suspense fallback={<DetailContentSkeleton />}>
<DetailContent submissionId={submissionId} />
</Suspense>
</div>
</PanelLayout>
);
};