mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 06:31:13 +00:00
Add codeString prop to Snippet for formatted JSON
Pass JSON.stringify(...) as the codeString prop to Snippet so structured message/response objects are rendered as pretty-printed JSON and can be copied via the tooltip. Changes applied in show_structed_message.tsx, display_card/render.tsx, and display_card/response.tsx.
This commit is contained in:
parent
38f6dad118
commit
7054535321
@ -10,6 +10,7 @@ const ShowStructedMessage = ({ messages }: ShowStructedMessageProps) => {
|
||||
return (
|
||||
<Snippet
|
||||
hideSymbol
|
||||
codeString={JSON.stringify(messages, null, 2)}
|
||||
tooltipProps={{
|
||||
content: '点击复制',
|
||||
}}
|
||||
|
||||
@ -121,6 +121,7 @@ const OneBotItemRender = ({ data, index, style }: OneBotItemRenderProps) => {
|
||||
<PopoverContent>
|
||||
<Snippet
|
||||
hideSymbol
|
||||
codeString={JSON.stringify(msg, null, 2)}
|
||||
tooltipProps={{
|
||||
content: '点击复制',
|
||||
}}
|
||||
|
||||
@ -41,6 +41,7 @@ const OneBotDisplayResponse: React.FC<OneBotDisplayResponseProps> = ({
|
||||
<PopoverContent>
|
||||
<Snippet
|
||||
hideSymbol
|
||||
codeString={JSON.stringify(data.data, null, 2)}
|
||||
tooltipProps={{
|
||||
content: '点击复制',
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user