mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +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.
|
||||
*/
|
||||
language: string
|
||||
children: React.ReactNode
|
||||
children?: React.ReactNode
|
||||
onHeightChange?: (scrollHeight: number) => void
|
||||
/**
|
||||
* Height of the scroll container.
|
||||
|
||||
@ -337,9 +337,12 @@ const AiApiCallError = ({ error }: { error: SerializedAiSdkAPICallError }) => {
|
||||
{error.responseBody && (
|
||||
<ErrorDetailItem>
|
||||
<ErrorDetailLabel>{t('error.responseBody')}:</ErrorDetailLabel>
|
||||
<CodeViewer className="source-view" language="json" expanded>
|
||||
{JSON.stringify(error.responseBody, null, 2)}
|
||||
</CodeViewer>
|
||||
<CodeViewer
|
||||
className="source-view"
|
||||
language="json"
|
||||
expanded
|
||||
value={JSON.stringify(error.responseBody, null, 2)}
|
||||
/>
|
||||
</ErrorDetailItem>
|
||||
)}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user