"use strict";var e=require("prop-types"),t=require("@material-ui/core/styles"),a=require("@material-ui/core/Card"),r=require("@material-ui/core/CardActions"),i=require("@material-ui/core/CardContent"),s=require("@material-ui/core/CardMedia"),n=require("@material-ui/core/Chip"),c=require("@material-ui/core/Button"),l=require("@material-ui/core/Typography"),o=require("@material-ui/icons/Email"),d=require("@material-ui/icons/Phone");require("../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js");var u=require("../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js");require("react"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/objectWithoutProperties"),require("react-router-dom"),require("query-string");var m=require("react/jsx-runtime"),f=require("./style.css.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=p(e),x=p(a),g=p(r),j=p(i),q=p(s),v=p(n),b=p(c),y=p(l),C=p(o),N=p(d),_="UserCardDialogPo";function B(e){var t=e.user,a=t.id,r=t.email,i=t.mobile,s=t.title,n=t.first_name,c=t.last_name,l=t.profile_photo,o=e.currentUser,d=e.classes;return m.jsxs(x.default,{"data-testid":"".concat(_),className:d.card,children:[m.jsx(q.default,{"data-testid":"".concat(_,"_placeholder"),className:d.media,image:l||"https://cdn.corva.ai/app/images/user-placeholder.svg",title:"".concat(n," ").concat(c),children:Number(o.id)===Number(a)&&m.jsx("div",{className:f.cUserCardMediaBackdrop,children:m.jsx(u.UniversalLink,{href:"/config/users/".concat(a),children:m.jsx(v.default,{"data-not-migrated-MuiChip":!0,"data-testid":"".concat(_,"_viewProfile"),className:f.cUserCardMediaBackdropToProfile,label:"View Profile"})})})}),m.jsxs(j.default,{className:d.content,children:[m.jsx(y.default,{"data-testid":"".concat(_,"_name"),variant:"h5",className:d.userName,children:"".concat(n," ").concat(c)}),s&&m.jsx(y.default,{variant:"subtitle1",children:s}),m.jsx("br",{}),r&&m.jsx("a",{href:"mailto:".concat(r),target:"_top",children:m.jsxs(y.default,{"data-testid":"".concat(_,"_email"),gutterBottom:!0,variant:"body1",className:d.contact,children:[m.jsx(C.default,{className:d.contactIcon}),r]})}),i&&m.jsx("a",{href:"tel:".concat(i),target:"_top",children:m.jsxs(y.default,{"data-testid":"".concat(_,"_phone"),variant:"body1",className:d.contact,children:[m.jsx(N.default,{className:d.contactIcon}),i]})})]}),m.jsxs(g.default,{className:d.actions,children:[r?m.jsx("a",{href:"mailto:".concat(r),target:"_top",children:m.jsx(b.default,{"data-testid":"".concat(_,"_emailButton"),className:d.actionButton,variant:"contained",color:"primary",children:"Email"})}):m.jsx(b.default,{disabled:!0,className:d.actionButton,variant:"contained",color:"primary",children:"Email"}),m.jsx(b.default,{"data-testid":"".concat(_,"_messageButton"),disabled:!0,className:d.actionButton,variant:"contained",color:"primary",children:"Message"})]})]})}B.propTypes={user:h.default.shape({id:h.default.number.isRequired,email:h.default.string,mobile:h.default.string,title:h.default.string,role:h.default.string,first_name:h.default.string.isRequired,last_name:h.default.string.isRequired,profile_photo:h.default.string}).isRequired,classes:h.default.shape({}).isRequired,currentUser:h.default.shape({id:h.default.oneOfType([h.default.number,h.default.string])})},B.defaultProps={currentUser:{}};var R=t.withStyles((function(e){return{card:{width:352},media:{height:264,width:"100%"},content:{cursor:"auto",padding:"10px 28px 28px 28px"},userName:{fontWeight:"bold"},contact:{display:"flex",alignItems:"center",fontSize:12,cursor:"pointer"},contactIcon:{height:15,width:15,marginRight:10,color:e.palette.grey[300]},actions:{display:"flex",justifyContent:"space-between",padding:"0 28px 28px 28px"},actionButton:{width:139}}}))(B);module.exports=R;
//# sourceMappingURL=index.js.map
