const setFileIconType = (fileName) => { let icoPath = ""; if (fileName.match(/\.(doc|docx|xls|xlsx|rtf)\b/) != null) { icoPath = "static/imgs/icons/doc.png"; } else if (fileName.match(/\.(7z|7zip|zip|tar.gz|tar.xz|gz|rar|jar)\b/) != null) { icoPath = "resources/images/icons/arc.png"; } else if (fileName.match(/\.(pdf)\b/) != null) { icoPath = "static/imgs/icons/pdf.png"; } else if (fileName.match(/\.(html)\b/) != null) { icoPath = "static/imgs/icons/html.png"; } else if (fileName.match(/\.(txt|conf)\b/) != null) { icoPath = "static/imgs/icons/text.png"; } else if (fileName.match(/\.(iso|img)\b/) != null) { icoPath = "static/imgs/icons/img.png"; } else if (fileName.match(/\.(sh|batch|exe)\b/) != null) { icoPath = "static/imgs/icons/scrip.png"; } else { icoPath = "static/imgs/icons/bin.png"; } return icoPath } // Create a ES6 class component class FilesList extends React.Component { // Use the render function to return JSX component render() { let final = []; let files = this.props.files[0]; console.log(files); for (let file of files) { final.push(