import React, { useMemo } from 'react';
import { ResourcedMention } from '@atlaskit/mention';
import ProfileCardTrigger from '@atlaskit/profilecard/user';
export default function MentionWithProfileCard({
  id,
  text,
  accessLevel,
  mentionProvider,
  profilecardProvider,
  onClick,
  onMouseEnter,
  onMouseLeave
}) {
  const {
    cloudId,
    resourceClient
  } = profilecardProvider;
  const actions = useMemo(() => profilecardProvider.getActions(id, text, accessLevel), [accessLevel, id, profilecardProvider, text]);
  return /*#__PURE__*/React.createElement(ProfileCardTrigger, {
    cloudId: cloudId,
    userId: id,
    resourceClient: resourceClient,
    actions: actions,
    trigger: "click",
    position: "bottom-end",
    testId: "mention-with-profilecard-trigger",
    ariaLabel: text.replace(/^@/, '')
  }, /*#__PURE__*/React.createElement(ResourcedMention, {
    id: id,
    text: text,
    accessLevel: accessLevel,
    mentionProvider: mentionProvider,
    onClick: onClick,
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave
  }));
}