import e from"prop-types";import{withStyles as t}from"@material-ui/core/styles";import r from"@material-ui/core/Card";import a from"@material-ui/core/CardActions";import i from"@material-ui/core/CardContent";import o from"@material-ui/core/CardMedia";import n from"@material-ui/core/Chip";import c from"@material-ui/core/Button";import s from"@material-ui/core/Typography";import l from"@material-ui/icons/Email";import m from"@material-ui/icons/Phone";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import{UniversalLink as d}from"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router-dom";import"query-string";import{jsxs as p,jsx as u}from"react/jsx-runtime";import h from"./style.css.js";var f="UserCardDialogPo";function g(e){var t=e.user,g=t.id,v=t.email,b=t.mobile,C=t.title,y=t.first_name,N=t.last_name,_=t.profile_photo,x=e.currentUser,B=e.classes;return p(r,{"data-testid":"".concat(f),className:B.card,children:[u(o,{"data-testid":"".concat(f,"_placeholder"),className:B.media,image:_||"https://cdn.corva.ai/app/images/user-placeholder.svg",title:"".concat(y," ").concat(N),children:Number(x.id)===Number(g)&&u("div",{className:h.cUserCardMediaBackdrop,children:u(d,{href:"/config/users/".concat(g),children:u(n,{"data-not-migrated-MuiChip":!0,"data-testid":"".concat(f,"_viewProfile"),className:h.cUserCardMediaBackdropToProfile,label:"View Profile"})})})}),p(i,{className:B.content,children:[u(s,{"data-testid":"".concat(f,"_name"),variant:"h5",className:B.userName,children:"".concat(y," ").concat(N)}),C&&u(s,{variant:"subtitle1",children:C}),u("br",{}),v&&u("a",{href:"mailto:".concat(v),target:"_top",children:p(s,{"data-testid":"".concat(f,"_email"),gutterBottom:!0,variant:"body1",className:B.contact,children:[u(l,{className:B.contactIcon}),v]})}),b&&u("a",{href:"tel:".concat(b),target:"_top",children:p(s,{"data-testid":"".concat(f,"_phone"),variant:"body1",className:B.contact,children:[u(m,{className:B.contactIcon}),b]})})]}),p(a,{className:B.actions,children:[v?u("a",{href:"mailto:".concat(v),target:"_top",children:u(c,{"data-testid":"".concat(f,"_emailButton"),className:B.actionButton,variant:"contained",color:"primary",children:"Email"})}):u(c,{disabled:!0,className:B.actionButton,variant:"contained",color:"primary",children:"Email"}),u(c,{"data-testid":"".concat(f,"_messageButton"),disabled:!0,className:B.actionButton,variant:"contained",color:"primary",children:"Message"})]})]})}g.propTypes={user:e.shape({id:e.number.isRequired,email:e.string,mobile:e.string,title:e.string,role:e.string,first_name:e.string.isRequired,last_name:e.string.isRequired,profile_photo:e.string}).isRequired,classes:e.shape({}).isRequired,currentUser:e.shape({id:e.oneOfType([e.number,e.string])})},g.defaultProps={currentUser:{}};var v=t((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}}}))(g);export{v as default};
//# sourceMappingURL=index.js.map
