-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { ContentType } from '../../../../types/enums'; | ||
import { isImageResponse } from '../../../services/actions/query-action-creator-util'; | ||
import { Image, Monaco } from '../../common'; | ||
import { formatXml } from '../../common/monaco/util/format-xml'; | ||
|
||
const ResponseDisplay = (properties: any) => { | ||
const { contentType, body, height } = properties; | ||
|
||
switch (contentType) { | ||
case ContentType.XML: | ||
return <Monaco body={formatXml(body)} language={ContentType.XML} readOnly={true} height={height} />; | ||
|
||
case ContentType.HTML: | ||
return <Monaco body={body} language={ContentType.HTML} readOnly={true} height={height} />; | ||
|
||
default: | ||
if (isImageResponse(contentType)) { | ||
return <Image | ||
styles={{ padding: '10px' }} | ||
body={body} | ||
alt='profile image' />; | ||
} | ||
return <Monaco body={body} readOnly={true} language={ContentType.Json} height={height} />; | ||
} | ||
} | ||
|
||
export default ResponseDisplay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters