mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2026-05-31 19:02:03 +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 type { AnalysisStatus, CodeAnalysis } from "@/generated/client";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import MdxPreview from "@/components/mdx-preview";
|
||||||
|
import { MdxComponents } from "@/components/content/mdx-components";
|
||||||
|
|
||||||
interface AnalysisCardProps {
|
interface AnalysisCardProps {
|
||||||
submissionId: string;
|
submissionId: string;
|
||||||
@ -192,12 +194,11 @@ export const AnalysisCard = ({ submissionId }: AnalysisCardProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="text-muted-foreground bg-muted/40 p-4 rounded-lg w-full border">
|
<MdxPreview
|
||||||
<h3 className="font-medium mb-2 text-foreground">{t("Feedback")}</h3>
|
source={analysis.feedback ?? t("NotAvailable")}
|
||||||
<p className="whitespace-pre-wrap leading-relaxed">
|
components={MdxComponents}
|
||||||
{analysis.feedback}
|
className="w-full"
|
||||||
</p>
|
/>
|
||||||
</div>
|
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ interface DetailContentProps {
|
|||||||
|
|
||||||
export const DetailContent = ({ submissionId }: DetailContentProps) => {
|
export const DetailContent = ({ submissionId }: DetailContentProps) => {
|
||||||
return (
|
return (
|
||||||
<ScrollArea className="h-full">
|
<ScrollArea className="min-h-0 flex-1">
|
||||||
<DetailTable submissionId={submissionId} />
|
<DetailTable submissionId={submissionId} />
|
||||||
<AnalysisContent submissionId={submissionId} />
|
<AnalysisContent submissionId={submissionId} />
|
||||||
<ScrollBar orientation="horizontal" />
|
<ScrollBar orientation="horizontal" />
|
||||||
|
|||||||
@ -21,10 +21,12 @@ export const DetailPanel = ({ submissionId }: DetailPanelProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PanelLayout isScroll={false}>
|
<PanelLayout isScroll={false}>
|
||||||
<DetailHeader />
|
<div className="flex h-full min-h-0 flex-col">
|
||||||
<Suspense fallback={<DetailContentSkeleton />}>
|
<DetailHeader />
|
||||||
<DetailContent submissionId={submissionId} />
|
<Suspense fallback={<DetailContentSkeleton />}>
|
||||||
</Suspense>
|
<DetailContent submissionId={submissionId} />
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
</PanelLayout>
|
</PanelLayout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user