11import React from "react" ;
2+ import { useTranslation } from "react-i18next" ;
23import { Button } from "../ui/button" ;
34import {
45 Dialog ,
@@ -9,6 +10,7 @@ import {
910} from "../ui/dialog" ;
1011import { Info } from "lucide-react" ;
1112import { type ToolCall } from "../../utils/toolCallParser" ;
13+ import { CodeMirrorViewer } from "../common/CodeMirrorViewer" ;
1214
1315interface Message {
1416 id : string ;
@@ -24,6 +26,8 @@ interface MessageActionsProps {
2426}
2527
2628export const MessageActions : React . FC < MessageActionsProps > = ( { message } ) => {
29+ const { t } = useTranslation ( ) ;
30+
2731 return (
2832 < div className = "mt-2 flex justify-start" >
2933 < Dialog >
@@ -34,17 +38,19 @@ export const MessageActions: React.FC<MessageActionsProps> = ({ message }) => {
3438 className = "h-6 px-2 text-xs text-muted-foreground hover:text-foreground"
3539 >
3640 < Info className = "h-3 w-3 mr-1" />
37- Raw JSON
41+ { t ( "dashboard.rawJsonButton" ) }
3842 </ Button >
3943 </ DialogTrigger >
4044 < DialogContent className = "max-w-2xl max-h-[80vh] overflow-y-auto" >
4145 < DialogHeader >
42- < DialogTitle > Message Raw JSON </ DialogTitle >
46+ < DialogTitle > { t ( "dashboard.rawJsonTitle" ) } </ DialogTitle >
4347 </ DialogHeader >
44- < div className = "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg" >
45- < pre className = "text-xs whitespace-pre-wrap break-all font-mono" >
46- { JSON . stringify ( message , null , 2 ) }
47- </ pre >
48+ < div className = "rounded-lg overflow-hidden border border-border" >
49+ < CodeMirrorViewer
50+ code = { JSON . stringify ( message , null , 2 ) }
51+ language = "json"
52+ readOnly = { true }
53+ />
4854 </ div >
4955 </ DialogContent >
5056 </ Dialog >
0 commit comments