"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkC3TMFBAQjs = require('./chunk-C3TMFBAQ.js');


var _chunk5V5EREDJjs = require('./chunk-5V5EREDJ.js');

// tmp-babel/messages/web/__shared__/GroupChatMembersList/ProfileCard/index.js
var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');
var _material = require('@mui/material');
var _reactrelay = require('react-relay');
var _jsxruntime = require('react/jsx-runtime');
var ProfileCard = function ProfileCard2(_ref) {
  var profile = _ref.profile, handleAddMember = _ref.handleAddMember, handleRemoveMember = _ref.handleRemoveMember, _ref$isMember = _ref.isMember, isMember = _ref$isMember === void 0 ? false : _ref$isMember;
  var _useFragment = _reactrelay.useFragment.call(void 0, _chunk5V5EREDJjs.ProfileItemFragment, profile), id = _useFragment.id, name = _useFragment.name, image = _useFragment.image, urlPath = _useFragment.urlPath;
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkC3TMFBAQjs.MainContainer, {
    children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _avatars.AvatarWithPlaceholder, {
      width: 48,
      height: 48,
      src: image === null || image === void 0 ? void 0 : image.url,
      sx: {
        alignSelf: "center",
        justifySelf: "center"
      }
    }), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, {
      sx: {
        display: "grid",
        gridTemplateRows: "repeat(2, minmax(0, 1fr))"
      },
      children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
        variant: "subtitle2",
        children: name
      }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
        variant: "caption",
        color: "text.secondary",
        children: (urlPath === null || urlPath === void 0 ? void 0 : urlPath.path) && "@".concat(urlPath.path)
      })]
    }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Button, {
      color: "inherit",
      variant: "text",
      size: "small",
      onClick: function onClick() {
        if (isMember) {
          handleRemoveMember(profile);
        } else {
          handleAddMember(profile);
        }
      },
      sx: {
        maxWidth: "fit-content",
        justifySelf: "end"
      },
      children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
        variant: "button",
        color: isMember ? "error.main" : "text.primary",
        children: isMember ? "Remove" : "Add"
      })
    })]
  }, "chat-room-item-".concat(id));
};
var ProfileCard_default = ProfileCard;



exports.ProfileCard_default = ProfileCard_default;
//# sourceMappingURL=chunk-A4KF2LIF.js.map