import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { Link as ExternalLink } from '@mui/material';
import DidAddress from '@arcblock/ux/lib/DID';
import { jsx as _jsx } from "react/jsx-runtime";
function WrappedDidAddress({
  did,
  href = '',
  external = false,
  avatarProps = {},
  to = '',
  ...rest
}) {
  const content = /*#__PURE__*/_jsx(DidAddress, {
    did: did,
    ...rest,
    avatarProps: avatarProps,
    to: to
  });
  if (href) {
    if (external) {
      return /*#__PURE__*/_jsx(ExternalLink, {
        target: "_blank",
        href: href,
        underline: "hover",
        children: content
      });
    }
    return /*#__PURE__*/_jsx(Link, {
      to: href,
      children: content
    });
  }
  return content;
}
WrappedDidAddress.propTypes = {
  did: PropTypes.string.isRequired,
  to: PropTypes.string,
  href: PropTypes.string,
  avatarProps: PropTypes.object,
  external: PropTypes.bool
};
export default WrappedDidAddress;