"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = LinkViewer;
var _clsx = _interopRequireDefault(require("clsx"));
var _i18n = require("@wordpress/i18n");
var _components = require("@wordpress/components");
var _icons = require("@wordpress/icons");
var _linkViewerUrl = _interopRequireDefault(require("./link-viewer-url"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function LinkViewer({
  className,
  linkClassName,
  onEditLinkClick,
  url,
  urlLabel,
  ...props
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    className: (0, _clsx.default)('block-editor-url-popover__link-viewer', className),
    ...props,
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_linkViewerUrl.default, {
      url: url,
      urlLabel: urlLabel,
      className: linkClassName
    }), onEditLinkClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
      icon: _icons.edit,
      label: (0, _i18n.__)('Edit'),
      onClick: onEditLinkClick,
      size: "compact"
    })]
  });
}
//# sourceMappingURL=link-viewer.js.map