diff --git a/src/library-authoring/component-info/ComponentAdvancedInfo.tsx b/src/library-authoring/component-info/ComponentAdvancedInfo.tsx index de93ac98ba..6fac7da4d5 100644 --- a/src/library-authoring/component-info/ComponentAdvancedInfo.tsx +++ b/src/library-authoring/component-info/ComponentAdvancedInfo.tsx @@ -20,7 +20,7 @@ import { } from '../data/apiHooks'; import messages from './messages'; -export const ComponentAdvancedInfo: React.FC> = () => { +const ComponentAdvancedInfoInner: React.FC> = () => { const intl = useIntl(); const { readOnly, sidebarComponentUsageKey: usageKey } = useLibraryContext(); @@ -48,72 +48,79 @@ export const ComponentAdvancedInfo: React.FC> = () => { }); }, [editorRef, olxUpdater, intl]); + return ( + <> +

+

{usageKey}

+

+ {(() => { + if (isOLXLoading) { return ; } + if (!olx) { return ; } + return ( +
+ {olxUpdater.error && ( + +

+ {/* + TODO: fix the API so it returns 400 errors in a JSON object, not HTML 500 errors. Then display + a useful error message here like "parsing the XML failed on line 3". + (olxUpdater.error as Record)?.customAttributes?.httpErrorResponseData.errorMessage + */} +
+ )} + {olx} + { + isEditingOLX ? ( + <> + + + + ) : !readOnly ? ( + + + + )} + > + + + ) : ( + null + ) + } +
+ ); + })()} +

+
    + { areAssetsLoading ?
  • : null } + { assets?.map(a => ( +
  • + {a.path}{' '} + () +
  • + )) } +
+ + ); +}; + +export const ComponentAdvancedInfo: React.FC> = () => { + const intl = useIntl(); return ( -
-

-

{usageKey}

-

- {(() => { - if (isOLXLoading) { return ; } - if (!olx) { return ; } - return ( -
- {olxUpdater.error && ( - -

- {/* - TODO: fix the API so it returns 400 errors in a JSON object, not HTML 500 errors. Then display - a useful error message here like "parsing the XML failed on line 3". - (olxUpdater.error as Record)?.customAttributes?.httpErrorResponseData.errorMessage - */} -
- )} - {olx} - { - isEditingOLX ? ( - <> - - - - ) : !readOnly ? ( - - - - )} - > - - - ) : ( - null - ) - } -
- ); - })()} -

-
    - { areAssetsLoading ?
  • : null } - { assets?.map(a => ( -
  • - {a.path}{' '} - () -
  • - )) } -
-
+
); };