= ({ options, data, width, height, repl
*/
if (!img) {
return renderContainer(
-
+
Nothing to display...
);
@@ -256,17 +258,17 @@ export const ImagePanel: React.FC = ({ options, data, width, height, repl
/**
* Set header
*/
- type = ImageTypesSymbols[img.charAt(0)];
+ type = IMAGE_TYPES_SYMBOLS[img.charAt(0)];
img = type ? `data:${type};base64,${img}` : `data:;base64,${img}`;
- } else if (Object.values(SupportedTypes).includes(m[1] as any)) {
+ } else if (Object.values(SupportedFileType).includes(m[1] as SupportedFileType)) {
type = m[1];
}
/**
* Convert PDF base64 to Blob and display
*/
- if (type === SupportedTypes.PDF) {
- const blob = base64toBlob(img, SupportedTypes.PDF);
+ if (type === SupportedFileType.PDF) {
+ const blob = base64toBlob(img, SupportedFileType.PDF);
img = URL.createObjectURL(blob);
/**
@@ -277,21 +279,21 @@ export const ImagePanel: React.FC = ({ options, data, width, height, repl
}
return renderContainer(
-
+
);
}
/**
* Display Video MP4 or WebM
*/
- if (type === SupportedTypes.MP4 || type === SupportedTypes.WEBM) {
+ if (type === SupportedFileType.MP4 || type === SupportedFileType.WEBM) {
return renderContainer(
@@ -301,9 +303,9 @@ export const ImagePanel: React.FC = ({ options, data, width, height, repl
/**
* Display Audio OGG or MP3
*/
- if (type === SupportedTypes.MP3 || type === SupportedTypes.OGG) {
+ if (type === SupportedFileType.MP3 || type === SupportedFileType.OGG) {
return renderContainer(
-