mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2026-05-31 10:18:52 +00:00
refactor(analysis): replace feedback display with MdxPreview component and adjust layout in detail panel
This commit is contained in:
parent
f0ea48ef06
commit
002f1ba681
@ -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>
|
||||
);
|
||||
|
||||
@ -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" />
|
||||
|
||||
@ -21,10 +21,12 @@ export const DetailPanel = ({ submissionId }: DetailPanelProps) => {
|
||||
|
||||
return (
|
||||
<PanelLayout isScroll={false}>
|
||||
<DetailHeader />
|
||||
<Suspense fallback={<DetailContentSkeleton />}>
|
||||
<DetailContent submissionId={submissionId} />
|
||||
</Suspense>
|
||||
<div className="flex h-full min-h-0 flex-col">
|
||||
<DetailHeader />
|
||||
<Suspense fallback={<DetailContentSkeleton />}>
|
||||
<DetailContent submissionId={submissionId} />
|
||||
</Suspense>
|
||||
</div>
|
||||
</PanelLayout>
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user