{"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 const ApartmentItem = ({\n  className,\n  accommodation,\n  house\n}) => {\n  const locale = useLocale();\n  const isDesktop = useIsDesktop();\n  console.log('ApartmentsList.js::25 accommodation', accommodation);\n  const ownSurfaceHtml = locale(`own-surface`).replace('#', `<span class='bold'>${accommodation.surface}</span>`);\n  const sharedSurfaceHtml = locale(`shared-surface`).replace('#', `<span class='bold'>${house.surface}</span>`);\n  const {\n    0: showApply,\n    1: setShowApply\n  } = useState(false); //const inner = <li\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: () => setShowApply(true),\n      icon: \"right\"\n    }), showApply && /*#__PURE__*/_jsx(TypeformOverlay, {\n      onClose: () => setShowApply(false)\n    })]\n  }, accommodation.key);\n};\n\nconst ApartmentsList = ({\n  accommodations,\n  house\n}) => {\n  return /*#__PURE__*/_jsx(List, {\n    classNameList: styles.list,\n    items: accommodations,\n    renderItem: accommodation => /*#__PURE__*/_jsx(ApartmentItem, {\n      house: house,\n      accommodation: accommodation\n    }, accommodation.key) // 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"}