"use strict";var e=require("@babel/runtime/helpers/defineProperty"),i=require("prop-types"),r=require("classnames"),l=require("@material-ui/core"),t=require("@material-ui/icons/Delete"),a=require("@material-ui/core/colors/grey"),s=require("./styles.css.js"),n=require("../../utils/main.js"),o=require("../../utils/fileExtension.js"),d=require("../FileTypeIcon.js"),c=require("../IconButton/index.js"),u=require("react/jsx-runtime");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=p(e),f=p(i),v=p(r),x=p(t),j=p(a),q=function(e){var i=e.fileName,r=e.fileUrl,t=e.handleFileDelete,a=e.classes,p=o.getIsImage(i);return u.jsxs("div",{className:v.default(s.cComponentFilePreview,a.wrapper),children:[p?u.jsx("div",{className:s.cComponentFilePreviewImageFileWrapper,children:u.jsx("img",{"data-testid":"".concat("filePreview","_filePreview"),className:s.cComponentFilePreviewImage,src:r,alt:"Uploaded file"})}):u.jsx("div",{className:s.cComponentFilePreviewWrapper,children:u.jsxs("div",{className:s.cComponentFilePreviewDownload,style:{border:"1px solid ".concat(j.default[400])},children:[u.jsx(d,{fileName:i,size:25}),u.jsx("div",{className:s.cComponentFilePreviewDownloadText,children:u.jsx(l.Typography,{"data-testid":"".concat("filePreview","_fileName"),variant:"subtitle2",noWrap:!0,children:n.default.getFileNameWithExtensionFromPath(i)})})]})}),u.jsx(c,{title:"Delete",onClick:t,className:v.default(s.cComponentFilePreviewDeleteFile,m.default({},s.cComponentFilePreviewDeleteFileCentered,!p)),tooltipProps:{title:"Delete"},children:u.jsx(x.default,{"data-testid":"".concat("filePreview","_deleteButton")})})]})};q.propTypes={fileName:f.default.string.isRequired,fileUrl:f.default.string.isRequired,handleFileDelete:f.default.func.isRequired,classes:f.default.shape({deleteTooltip:f.default.string.isRequired}).isRequired};var w=l.withStyles({deleteTooltip:{marginTop:"3px",backgroundColor:"rgba(97, 97, 97, 0.4)"}})(q);module.exports=w;
//# sourceMappingURL=index.js.map
