"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.GooglePreviewWebsiteInfo = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireWildcard(require("react"));
var _GooglePreviewSt = require("../GooglePreview.st.css.js");
var _constants = require("../constants");
var _GooglePreviewFavicon = require("./GooglePreviewFavicon");
var _Text = _interopRequireDefault(require("../../Text"));
var _Tooltip = _interopRequireDefault(require("../../Tooltip"));
var _GooglePreviewUtils = require("../GooglePreviewUtils");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/GooglePreview/components/GooglePreviewWebsiteInfo.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var GooglePreviewWebsiteInfo = _ref => {
  var {
    previewUrl,
    favicon,
    siteName,
    onClick,
    tooltipContent,
    tooltipProps
  } = _ref;
  var formattedUrl = (0, _react.useMemo)(() => (0, _GooglePreviewUtils.replaceSlash)(previewUrl), [previewUrl]);
  return /*#__PURE__*/_react.default.createElement("button", {
    onClick: onClick,
    "data-hook": _constants.dataHooks.GooglePreviewWebsiteInfo,
    className: _GooglePreviewSt.classes.googlePreviewWebsiteInfoCTA,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, (0, _extends2.default)({
    content: tooltipContent,
    disabled: !tooltipContent
  }, tooltipProps, {
    dataHook: _constants.dataHooks.GooglePreviewWebsiteInfoTooltip,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 37,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _GooglePreviewSt.classes.googlePreviewWebsiteInfo,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 43,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react.default.createElement(_GooglePreviewFavicon.GooglePreviewFavicon, {
    faviconUrl: favicon,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 44,
      columnNumber: 11
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _GooglePreviewSt.classes.googlePreviewWebsiteInfoContent,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 45,
      columnNumber: 11
    }
  }, /*#__PURE__*/_react.default.createElement(_Text.default, {
    weight: "thin",
    size: "tiny",
    light: false,
    secondary: false,
    className: _GooglePreviewSt.classes.googlePreviewSiteName,
    dataHook: _constants.dataHooks.GooglePreviewSiteName,
    ellipsis: true,
    showTooltip: false,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 46,
      columnNumber: 13
    }
  }, siteName), /*#__PURE__*/_react.default.createElement(_Text.default, {
    weight: "thin",
    size: "tiny",
    light: false,
    className: _GooglePreviewSt.classes.googlePreviewUrl,
    dataHook: _constants.dataHooks.GooglePreviewPreviewUrl,
    ellipsis: true,
    showTooltip: false,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 58,
      columnNumber: 13
    }
  }, formattedUrl)))));
};
exports.GooglePreviewWebsiteInfo = GooglePreviewWebsiteInfo;
//# sourceMappingURL=GooglePreviewWebsiteInfo.js.map