summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index aa59201cb..e48ffed9a 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -533,6 +533,19 @@ module.exports.getFileType = function(ext) {
return "other";
};
+module.exports.getPreviewImagePathForFileType = function(fileType) {
+ fileType = fileType.toLowerCase();
+
+ var icon;
+ if (fileType in Constants.ICON_FROM_TYPE) {
+ icon = Constants.ICON_FROM_TYPE[fileType];
+ } else {
+ icon = Constants.ICON_FROM_TYPE["other"];
+ }
+
+ return "/static/images/icons/" + icon + ".png";
+};
+
module.exports.getIconClassName = function(fileType) {
fileType = fileType.toLowerCase();