{"ast":null,"code":"import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport cn from 'classnames';\nimport Bubble from 'components/bubble/Bubble';\nimport BoxButton from 'components/gui/BoxButton';\nimport CircleButton from 'components/gui/CircleButton';\nimport HouseInfos from 'components/houseInfos/HouseInfos';\nimport List from 'components/list/List';\nimport StatusBanner from 'components/statusBanner/StatusBanner';\nimport { TypeformOverlay } from 'components/typeform/Typeform';\nimport useLang from 'contexts/useLang';\nimport useLocale from 'contexts/useLocale';\nimport useLocaleDate from 'contexts/useLocaleDate';\nimport { useIsDesktop } from 'hooks/useIsDevice';\nimport HTMLReactParser from 'html-react-parser';\nimport { getNewsPage, imageBuilder } from 'lib/api';\nimport Link from 'next/link';\nimport { useState } from 'react';\nimport styles from './ApartmentsList.module.scss';\nexport var ApartmentItem = function ApartmentItem(_ref) {\n  var className = _ref.className,\n      accommodation = _ref.accommodation,\n      house = _ref.house;\n  var locale = useLocale();\n  var isDesktop = useIsDesktop();\n  console.log('ApartmentsList.js::25 accommodation', accommodation);\n  var ownSurfaceHtml = locale(\"own-surface\").replace('#', \"<span class='bold'>\".concat(accommodation.surface, \"</span>\"));\n  var sharedSurfaceHtml = locale(\"shared-surface\").replace('#', \"<span class='bold'>\".concat(house.surface, \"</span>\"));\n\n  var _useState = useState(false),\n      showApply = _useState[0],\n      setShowApply = _useState[1]; //const inner = <li\n\n\n  return /*#__PURE__*/_jsxs(\"li\", {\n    className: cn(styles.listItem, // highlight && styles.highlight,\n    // !house.open && styles.notOpened,\n    className),\n    children: [/*#__PURE__*/_jsxs(\"div\", {\n      className: cn(styles.title),\n      children: [/*#__PURE__*/_jsx(\"h3\", {\n        className: cn('h--3'),\n        children: accommodation.title\n      }), /*#__PURE__*/_jsx(StatusBanner, {\n        className: cn(styles.banner),\n        status: accommodation.statusTextKey || 'available'\n      })]\n    }), /*#__PURE__*/_jsxs(\"div\", {\n      className: cn(styles.infosContainer),\n      children: [/*#__PURE__*/_jsxs(\"div\", {\n        style: {\n          flex: 1\n        },\n        children: [/*#__PURE__*/_jsx(\"p\", {\n          className: cn('p--m'),\n          children: HTMLReactParser(ownSurfaceHtml)\n        }), /*#__PURE__*/_jsx(\"p\", {\n          className: cn('p--m'),\n          children: HTMLReactParser(sharedSurfaceHtml)\n        })]\n      }), /*#__PURE__*/_jsxs(\"div\", {\n        children: [/*#__PURE__*/_jsx(\"p\", {\n          className: cn('p--m', 'bold'),\n          children: accommodation.price\n        }), /*#__PURE__*/_jsx(\"p\", {\n          className: cn('p--m'),\n          children: locale('taxes-included')\n        })]\n      }), /*#__PURE__*/_jsx(CircleButton, {\n        className: cn(styles.priceButton),\n        icon: \"info\",\n        size: \"small\",\n        color: \"white\"\n      })]\n    }), /*#__PURE__*/_jsx(BoxButton, {\n      className: cn(styles.button),\n      label: locale('apply'),\n      fullWidth: true,\n      onClick: function onClick() {\n        return setShowApply(true);\n      },\n      icon: \"right\"\n    }), showApply && /*#__PURE__*/_jsx(TypeformOverlay, {\n      onClose: function onClose() {\n        return setShowApply(false);\n      }\n    })]\n  }, accommodation.key);\n};\n\nvar ApartmentsList = function ApartmentsList(_ref2) {\n  var accommodations = _ref2.accommodations,\n      house = _ref2.house;\n  return /*#__PURE__*/_jsx(List, {\n    classNameList: styles.list,\n    items: accommodations,\n    renderItem: function renderItem(accommodation) {\n      return /*#__PURE__*/_jsx(ApartmentItem, {\n        house: house,\n        accommodation: accommodation\n      }, accommodation.key);\n    } // filters={[\n    //    { label: 'Toutes', filter: house => true },\n    //    { label: 'Libres', filter: house => house.canApply },\n    //    { label: 'Futures', filter: house => !house.open },\n    // ]}\n    // searchFilter={\n    //    (house, input) =>\n    //       house.title.toLowerCase().includes(input)\n    //       || (house.area && house.area.toLowerCase().includes(input))\n    //       || (house.location && house.location.toLowerCase().includes(input))\n    // }\n\n  });\n};\n\nexport default ApartmentsList;","map":null,"metadata":{},"sourceType":"module"}