mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 22:39:36 +08:00
refactor(CodeViewer): make children prop optional for improved flexibility
This commit is contained in:
parent
a681c28a0a
commit
3d555943c4
@ -19,7 +19,7 @@ interface CodeViewerProps {
|
|||||||
* - Supports shiki aliases: c#/csharp, objective-c++/obj-c++/objc++, etc.
|
* - Supports shiki aliases: c#/csharp, objective-c++/obj-c++/objc++, etc.
|
||||||
*/
|
*/
|
||||||
language: string
|
language: string
|
||||||
children: React.ReactNode
|
children?: React.ReactNode
|
||||||
onHeightChange?: (scrollHeight: number) => void
|
onHeightChange?: (scrollHeight: number) => void
|
||||||
/**
|
/**
|
||||||
* Height of the scroll container.
|
* Height of the scroll container.
|
||||||
|
|||||||
@ -337,9 +337,12 @@ const AiApiCallError = ({ error }: { error: SerializedAiSdkAPICallError }) => {
|
|||||||
{error.responseBody && (
|
{error.responseBody && (
|
||||||
<ErrorDetailItem>
|
<ErrorDetailItem>
|
||||||
<ErrorDetailLabel>{t('error.responseBody')}:</ErrorDetailLabel>
|
<ErrorDetailLabel>{t('error.responseBody')}:</ErrorDetailLabel>
|
||||||
<CodeViewer className="source-view" language="json" expanded>
|
<CodeViewer
|
||||||
{JSON.stringify(error.responseBody, null, 2)}
|
className="source-view"
|
||||||
</CodeViewer>
|
language="json"
|
||||||
|
expanded
|
||||||
|
value={JSON.stringify(error.responseBody, null, 2)}
|
||||||
|
/>
|
||||||
</ErrorDetailItem>
|
</ErrorDetailItem>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user