// tmp-babel/profiles/web/profile-popover/CurrentProfile/index.js
import { useCurrentProfile } from "@baseapp-frontend/authentication";
import { AvatarWithPlaceholder } from "@baseapp-frontend/design-system/components/web/avatars";
import { Box, Typography } from "@mui/material";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var CurrentProfile = function CurrentProfile2() {
  var _profile$image, _profile$urlPath;
  var _useCurrentProfile = useCurrentProfile(), profile = _useCurrentProfile.currentProfile;
  if (!profile) return null;
  return /* @__PURE__ */ _jsxs(Box, {
    sx: {
      m: 1.5,
      mb: 0,
      px: 1,
      py: 0.75,
      gap: 1.5
    },
    display: "flex",
    alignItems: "center",
    children: [/* @__PURE__ */ _jsx(AvatarWithPlaceholder, {
      width: 40,
      height: 40,
      src: (_profile$image = profile === null || profile === void 0 ? void 0 : profile.image) !== null && _profile$image !== void 0 ? _profile$image : "",
      alt: "Current profile avatar",
      color: "secondary"
    }), /* @__PURE__ */ _jsxs(Box, {
      display: "flex",
      flexDirection: "column",
      flexGrow: 1,
      overflow: "hidden",
      children: [/* @__PURE__ */ _jsx(Typography, {
        component: "p",
        variant: "subtitle2",
        noWrap: true,
        children: profile.name
      }), (profile === null || profile === void 0 ? void 0 : profile.urlPath) && /* @__PURE__ */ _jsx(Typography, {
        variant: "body2",
        sx: {
          color: "text.secondary"
        },
        noWrap: true,
        children: profile === null || profile === void 0 || (_profile$urlPath = profile.urlPath) === null || _profile$urlPath === void 0 ? void 0 : _profile$urlPath.replace("/", "")
      })]
    })]
  });
};
var CurrentProfile_default = CurrentProfile;

export {
  CurrentProfile_default
};
//# sourceMappingURL=chunk-NH7KZ2QM.mjs.map