refactor(CodeViewer): make children prop optional for improved flexibility
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user