{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport cn from 'classnames';\nimport BoxButton from 'components/gui/BoxButton';\nimport CustomBlockContent from 'components/gui/CustomBlockContent';\nimport useLocale from 'contexts/useLocale';\nimport styles from './HouseInfos.module.scss';\nimport HTMLReactParser from 'html-react-parser';\nimport Bubble from 'components/bubble/Bubble';\nimport Link from 'next/link';\nexport var HouseInfos = function HouseInfos(_ref) {\n  var house = _ref.house,\n      style = _ref.style,\n      className = _ref.className,\n      smaller = _ref.smaller,\n      narrow = _ref.narrow,\n      buttonLabel = _ref.buttonLabel,\n      buttonHref = _ref.buttonHref,\n      buttonClassName = _ref.buttonClassName,\n      renderTitle = _ref.renderTitle,\n      renderText = _ref.renderText,\n      white = _ref.white;\n  var title = house.title,\n      status = house.status,\n      statusTextKey = house.statusTextKey,\n      statusColor = house.statusColor,\n      area = house.area,\n      surface = house.surface,\n      canApply = house.canApply,\n      accommodations = house.accommodations,\n      accommodationsCount = house.accommodationsCount,\n      availableCount = house.availableCount,\n      fullHouse = house.fullHouse,\n      cheapest = house.cheapest,\n      text = house.text,\n      open = house.open;\n  var locale = useLocale();\n  var accommodationsCountHtml = locale(\"accommodations-count\", accommodationsCount).replace('#', \"<span class='bold'>\".concat(accommodationsCount, \"</span>\"));\n  var availableCountHtml = accommodations.length > 0 && (fullHouse ? \"<span class='bold'>\".concat(locale(\"house-full\"), \".</span>\") : locale(\"available-accommodations\", availableCount).replace('#', \"<span class='bold'>\".concat(availableCount, \"</span>\")));\n  var cheapestHtml = !fullHouse && cheapest < 9999 && locale(\"price-from\").replace('#', \"<span class='bold'>\".concat(cheapest, \"\\u20AC</span>\"));\n  return /*#__PURE__*/_jsxs(\"div\", {\n    className: cn(styles.houseInfos, (smaller || narrow) && styles.smaller, className),\n    style: _objectSpread({}, style),\n    children: [/*#__PURE__*/_jsxs(\"div\", {\n      children: [/*#__PURE__*/_jsx(\"div\", {\n        className: cn(styles.houseInfosGrid),\n        children: renderTitle && /*#__PURE__*/_jsx(\"div\", {\n          style: {\n            flex: 1\n          },\n          children: smaller ? /*#__PURE__*/_jsx(Link, {\n            href: house.url,\n            as: house.url,\n            children: /*#__PURE__*/_jsx(\"a\", {\n              children: /*#__PURE__*/_jsx(\"h2\", {\n                className: cn(smaller ? 'h--3' : 'h--1', styles.title),\n                children: title\n              })\n            })\n          }) : /*#__PURE__*/_jsx(\"h2\", {\n            className: cn(smaller ? 'h--3' : 'h--1', styles.title),\n            children: title\n          })\n        })\n      }), /*#__PURE__*/_jsxs(\"div\", {\n        className: cn(styles.houseInfosGrid),\n        children: [/*#__PURE__*/_jsx(\"div\", {\n          style: {\n            flex: 1\n          },\n          children: area && area.split('\\n').map(function (line, i) {\n            return /*#__PURE__*/_jsx(\"p\", {\n              className: cn('p--m'),\n              children: line\n            }, i);\n          })\n        }), /*#__PURE__*/_jsxs(\"div\", {\n          style: {\n            flex: 0.7\n          },\n          children: [accommodationsCount > 0 && house.status == 'future-closed' && /*#__PURE__*/_jsx(\"p\", {\n            className: cn('p--m', 'bold'),\n            children: locale('soon')\n          }), accommodationsCount > 0 && /*#__PURE__*/_jsx(\"p\", {\n            className: cn('p--m'),\n            children: HTMLReactParser(accommodationsCountHtml)\n          }), availableCountHtml && /*#__PURE__*/_jsx(\"p\", {\n            className: cn('p--m'),\n            children: HTMLReactParser(availableCountHtml)\n          })]\n        })]\n      }), (!smaller || !fullHouse || !open) && /*#__PURE__*/_jsxs(\"div\", {\n        className: cn(styles.houseInfosGrid),\n        children: [surface && /*#__PURE__*/_jsxs(\"div\", {\n          style: {\n            flex: 1\n          },\n          children: [/*#__PURE__*/_jsx(\"p\", {\n            className: cn('p--m'),\n            children: locale('house-surface-area')\n          }), /*#__PURE__*/_jsx(\"p\", {\n            className: cn('p--m', 'bold'),\n            children: surface\n          })]\n        }), cheapestHtml && /*#__PURE__*/_jsx(\"div\", {\n          style: {\n            flex: 0.7\n          },\n          children: /*#__PURE__*/_jsx(\"p\", {\n            className: cn('p--m'),\n            children: HTMLReactParser(cheapestHtml)\n          })\n        })]\n      })]\n    }), renderText && text && /*#__PURE__*/_jsx(CustomBlockContent, {\n      className: cn('p--m', styles.text),\n      blocks: text\n    }), buttonLabel && /*#__PURE__*/_jsx(\"div\", {\n      children: /*#__PURE__*/_jsx(BoxButton, {\n        className: cn(styles.button, buttonClassName),\n        label: buttonLabel,\n        href: buttonHref,\n        fullWidth: true,\n        icon: \"right\",\n        white: white\n      })\n    })]\n  });\n};\nexport default HouseInfos;","map":null,"metadata":{},"sourceType":"module"}