"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js");require("@mui/material");var r,n,i,a,t,l=require("../../_virtual/index.js"),o=require("react"),s=require("styled-components"),d=require("react/jsx-runtime"),c=function(r){var n=o.useRef(null),i=o.useState(!1),a=e.slicedToArray(i,2),t=a[0],l=a[1];return d.jsxs(u,{children:[d.jsxs(g,{className:t?"drag-over":"",onClick:function(){n.current.click()},onDragOver:function(e){e.preventDefault(),l(!0)},onDragLeave:function(){l(!1)},onDrop:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&r.onFileChange({target:{files:e.dataTransfer.files}}),l(!1)},children:[d.jsxs(f,{children:[r.label,r.required&&"*"]}),d.jsxs(x,{children:["Drag & Drop file here or ",d.jsx("strong",{children:"Click to upload"})," (file name:"," ",r.fileName||"No file chosen",")"]})]}),d.jsx(p,{accept:r.accept||"*",type:"file",ref:n,onChange:r.onFileChange,required:r.required})]})};c.PropTypes={onFileChange:l.default.func};var u=s.div(r||(r=e.taggedTemplateLiteral(['\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  padding: 0px 1px;\n  font-family: "Roboto", "Helvetica", "Arial", sans-serif;\n']))),p=s.input(n||(n=e.taggedTemplateLiteral(["\n  display: none;\n"]))),g=s.div(i||(i=e.taggedTemplateLiteral(["\n  width: 100%;\n  height: 54px;\n  border: 1px solid rgb(202, 202, 202);\n  border-radius: 5px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  text-align: center;\n  cursor: pointer;\n  transition: background 0.3s ease;\n  color: rgb(102, 102, 102);\n\n  &:hover {\n    border-color: rgb(33, 33, 33);\n  }\n\n  &.drag-over {\n    border-color: rgb(33, 33, 33);\n  }\n"]))),f=s.div(a||(a=e.taggedTemplateLiteral(["\n  display: flex;\n  margin-left: 13px;\n"]))),x=s.div(t||(t=e.taggedTemplateLiteral(["\n  flex: 1;\n"])));exports.default=c;
//# sourceMappingURL=FileInputComponent.js.map
