Skip to content

Commit 10efc96

Browse files
committed
refactor: replace Card component with CodeBlock for improved JSON data rendering in AIGatewayLogTable
1 parent 7cd02a4 commit 10efc96

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/client/components/aiGateway/AIGatewayLogTable.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Button } from '../ui/button';
1717
import dayjs from 'dayjs';
1818
import { Empty } from 'antd';
1919
import { useEvent } from '@/hooks/useEvent';
20-
import { Card, CardContent } from '../ui/card';
20+
import { CodeBlock } from '../CodeBlock';
2121
import { AIGatewayStatus } from './AIGatewayStatus';
2222

2323
interface AIGatewayLogTableProps {
@@ -65,15 +65,7 @@ export const AIGatewayLogTable: React.FC<AIGatewayLogTableProps> = React.memo(
6565

6666
const renderJsonData = (data: any) => {
6767
try {
68-
return (
69-
<Card>
70-
<CardContent className="p-2">
71-
<pre className="max-h-80 overflow-auto whitespace-pre-wrap text-xs">
72-
{JSON.stringify(data, null, 2)}
73-
</pre>
74-
</CardContent>
75-
</Card>
76-
);
68+
return <CodeBlock code={JSON.stringify(data, null, 2)} />;
7769
} catch (err) {
7870
return <div className="text-red-500">{String(err)}</div>;
7971
}

0 commit comments

Comments
 (0)