Compare commits

...

1 Commits

Author SHA1 Message Date
手瓜一十雪
7054535321 Add codeString prop to Snippet for formatted JSON
Some checks are pending
Build NapCat Artifacts / Build-Framework (push) Waiting to run
Build NapCat Artifacts / Build-Shell (push) Waiting to run
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.
2026-02-04 12:33:18 +08:00
3 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,7 @@ const ShowStructedMessage = ({ messages }: ShowStructedMessageProps) => {
return (
<Snippet
hideSymbol
codeString={JSON.stringify(messages, null, 2)}
tooltipProps={{
content: '点击复制',
}}

View File

@ -121,6 +121,7 @@ const OneBotItemRender = ({ data, index, style }: OneBotItemRenderProps) => {
<PopoverContent>
<Snippet
hideSymbol
codeString={JSON.stringify(msg, null, 2)}
tooltipProps={{
content: '点击复制',
}}

View File

@ -41,6 +41,7 @@ const OneBotDisplayResponse: React.FC<OneBotDisplayResponseProps> = ({
<PopoverContent>
<Snippet
hideSymbol
codeString={JSON.stringify(data.data, null, 2)}
tooltipProps={{
content: '点击复制',
}}