chore: fix indentation in API tab json for empty nested objects/arrays (#6150)

This commit is contained in:
Jessica Chowdhury
2024-05-14 15:44:10 +01:00
committed by GitHub
parent f6039246c6
commit 57b072edfc

View File

@@ -52,9 +52,9 @@ export const RenderJSON = ({
const objectKeys = object ? Object.keys(object) : []
const objectLength = objectKeys.length
const [isOpen, setIsOpen] = React.useState<boolean>(true)
const isNestedAndEmpty = isEmpty && (parentType === 'object' || parentType === 'array')
return (
<li>
<li className={isNestedAndEmpty ? `${baseClass}__row-line--nested` : ''}>
<button
aria-label="toggle"
className={`${baseClass}__list-toggle ${isEmpty ? `${baseClass}__list-toggle--empty` : ''}`}