"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),a=require("prop-types"),s=require("@material-ui/core"),t=require("./UserCard/index.js"),i=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=u(e),p=u(a);function l(e){var a=r.useState(null),u=n.default(a,2),p=u[0],l=u[1],o=Boolean(p);return i.jsxs(i.Fragment,{children:[i.jsx("div",{"aria-owns":o?"user-popover":void 0,"aria-haspopup":"true",onClick:function(e){l(e.currentTarget)},className:e.classes.childrenWrapper,style:e.wrapperStyle,children:e.children}),i.jsx(s.Popover,{id:"user-popover",open:o,classes:{paper:e.classes.popoverPaper},anchorEl:p,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:function(){l(null)},children:i.jsx(t,{user:e.user,currentUser:e.currentUser})})]})}l.propTypes={wrapperStyle:p.default.shape({}),user:p.default.shape({}).isRequired,children:p.default.node.isRequired,currentUser:p.default.shape({}),classes:p.default.shape({popoverPaper:p.default.string.isRequired,childrenWrapper:p.default.string.isRequired}).isRequired},l.defaultProps={wrapperStyle:{},currentUser:{}};var o=s.withStyles({popoverPaper:{background:"transparent"},childrenWrapper:{cursor:"pointer"}})(l);module.exports=o;
