@admin-layout/tailwind-design-pro 10.0.9-alpha.6 → 10.0.9-alpha.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +345 -1
  2. package/lib/cdm-locales/en/settings.json +21 -1
  3. package/lib/cdm-locales/es/settings.json +23 -3
  4. package/lib/components/Layout/BasicLayout/index.d.ts +1 -2
  5. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  6. package/lib/components/Layout/BasicLayout/index.js +102 -37
  7. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  8. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts +1 -8
  9. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
  10. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
  11. package/lib/components/Layout/GlobalHeader/Header.d.ts +2 -15
  12. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  13. package/lib/components/Layout/GlobalHeader/Header.js +44 -21
  14. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  15. package/lib/components/Layout/GlobalHeader/Logo.d.ts +4 -0
  16. package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +1 -0
  17. package/lib/components/Layout/GlobalHeader/Logo.js +141 -0
  18. package/lib/components/Layout/GlobalHeader/Logo.js.map +1 -0
  19. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +6 -0
  20. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -0
  21. package/lib/components/Layout/GlobalHeader/MainHeader.js +226 -0
  22. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -0
  23. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts +1 -12
  24. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
  25. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  26. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -13
  27. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  28. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
  29. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts +4 -0
  30. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -0
  31. package/lib/components/Layout/GlobalHeader/RightMenu.js +290 -0
  32. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -0
  33. package/lib/components/Layout/GlobalHeader/index.d.ts +4 -0
  34. package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -0
  35. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  36. package/lib/components/Layout/ProTailwindLayout.js +1 -2
  37. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  38. package/lib/components/Layout/Sidebar/Divider.d.ts +1 -31
  39. package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
  40. package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
  41. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +5 -0
  42. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -0
  43. package/lib/components/Layout/Sidebar/DynamicIcon.js +51 -0
  44. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
  45. package/lib/components/Layout/Sidebar/Sidebar.d.ts +1 -12
  46. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
  47. package/lib/components/Layout/Sidebar/Sidebar.js +107 -91
  48. package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
  49. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
  50. package/lib/components/Layout/Sidebar/SidebarMenu.js +110 -20
  51. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
  52. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  53. package/lib/components/Layout/TailwindLayout.js +29 -19
  54. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  55. package/lib/components/Layout/getPageTitle.d.ts +1 -16
  56. package/lib/components/Layout/getPageTitle.d.ts.map +1 -1
  57. package/lib/components/Layout/getPageTitle.js +2 -2
  58. package/lib/components/Layout/getPageTitle.js.map +1 -1
  59. package/lib/components/Layout/slot-fill/Footer.d.ts +1 -1
  60. package/lib/components/Layout/slot-fill/Footer.d.ts.map +1 -1
  61. package/lib/components/Layout/slot-fill/Footer.js +6 -6
  62. package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
  63. package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts +3 -0
  64. package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts.map +1 -0
  65. package/lib/components/Layout/slot-fill/HeaderSearchBar.js +6 -0
  66. package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -0
  67. package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts +3 -0
  68. package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts.map +1 -0
  69. package/lib/components/Layout/slot-fill/HeaderSearchButton.js +6 -0
  70. package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -0
  71. package/lib/components/Layout/slot-fill/RightContent.d.ts +3 -0
  72. package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -0
  73. package/lib/components/Layout/slot-fill/RightContent.js +6 -0
  74. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -0
  75. package/lib/components/Layout/slot-fill/index.d.ts +3 -0
  76. package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
  77. package/lib/components/Layout/util.js +12 -0
  78. package/lib/components/Layout/util.js.map +1 -0
  79. package/lib/components/SettingDrawer/LayoutChange.d.ts +1 -1
  80. package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
  81. package/lib/components/SettingDrawer/LayoutChange.js +75 -17
  82. package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
  83. package/lib/components/SettingDrawer/NavigationsModes.d.ts +1 -1
  84. package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
  85. package/lib/components/SettingDrawer/NavigationsModes.js +18 -10
  86. package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
  87. package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
  88. package/lib/components/SettingDrawer/RegionalSettings.js +609 -32
  89. package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
  90. package/lib/components/SettingDrawer/SettingDrawer.d.ts +1 -1
  91. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  92. package/lib/components/SettingDrawer/SettingDrawer.js +183 -38
  93. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  94. package/lib/components/SettingDrawer/WebFontsSelector.d.ts +3 -0
  95. package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +1 -0
  96. package/lib/components/SettingDrawer/WebFontsSelector.js +24 -0
  97. package/lib/components/SettingDrawer/WebFontsSelector.js.map +1 -0
  98. package/lib/components/SettingDrawer/types.d.ts +23 -2
  99. package/lib/components/SettingDrawer/types.d.ts.map +1 -1
  100. package/lib/components/ThemeProvider/ThemeProvider.d.ts +6 -16
  101. package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
  102. package/lib/components/ThemeProvider/ThemeProvider.js +26 -29
  103. package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -1
  104. package/lib/components/ThemeProvider/ThemeToggle.js +50 -0
  105. package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -0
  106. package/lib/components/ThemeProvider/index.d.ts +2 -5
  107. package/lib/components/ThemeProvider/index.d.ts.map +1 -1
  108. package/lib/components/ThemeProvider/themes/airbnb.d.ts +3 -0
  109. package/lib/components/ThemeProvider/themes/airbnb.d.ts.map +1 -0
  110. package/lib/components/ThemeProvider/themes/airbnb.js +186 -0
  111. package/lib/components/ThemeProvider/themes/airbnb.js.map +1 -0
  112. package/lib/components/ThemeProvider/themes/default.d.ts +3 -0
  113. package/lib/components/ThemeProvider/themes/default.d.ts.map +1 -0
  114. package/lib/components/ThemeProvider/themes/default.js +183 -0
  115. package/lib/components/ThemeProvider/themes/default.js.map +1 -0
  116. package/lib/components/ThemeProvider/themes/github.d.ts +3 -0
  117. package/lib/components/ThemeProvider/themes/github.d.ts.map +1 -0
  118. package/lib/components/ThemeProvider/themes/github.js +190 -0
  119. package/lib/components/ThemeProvider/themes/github.js.map +1 -0
  120. package/lib/components/ThemeProvider/themes/index.d.ts +15 -0
  121. package/lib/components/ThemeProvider/themes/index.d.ts.map +1 -0
  122. package/lib/components/ThemeProvider/themes/index.js +7 -0
  123. package/lib/components/ThemeProvider/themes/index.js.map +1 -0
  124. package/lib/components/ThemeProvider/themes/slack.d.ts +3 -0
  125. package/lib/components/ThemeProvider/themes/slack.d.ts.map +1 -0
  126. package/lib/components/ThemeProvider/themes/slack.js +188 -0
  127. package/lib/components/ThemeProvider/themes/slack.js.map +1 -0
  128. package/lib/components/ThemeProvider/themes/spotify.d.ts +3 -0
  129. package/lib/components/ThemeProvider/themes/spotify.d.ts.map +1 -0
  130. package/lib/components/ThemeProvider/themes/spotify.js +189 -0
  131. package/lib/components/ThemeProvider/themes/spotify.js.map +1 -0
  132. package/lib/components/ThemeProvider/types.d.ts +106 -106
  133. package/lib/components/ThemeProvider/types.d.ts.map +1 -1
  134. package/lib/components/UI/CategoriesTypeList.d.ts +29 -0
  135. package/lib/components/UI/CategoriesTypeList.d.ts.map +1 -0
  136. package/lib/components/UI/CategoriesTypeList.js +140 -0
  137. package/lib/components/UI/CategoriesTypeList.js.map +1 -0
  138. package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +83 -0
  139. package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +1 -0
  140. package/lib/components/UI/LazyLoadingGoogleMarker.js +107 -0
  141. package/lib/components/UI/LazyLoadingGoogleMarker.js.map +1 -0
  142. package/lib/components/UI/Pagination.d.ts +6 -0
  143. package/lib/components/UI/Pagination.d.ts.map +1 -0
  144. package/lib/components/UI/Pagination.js +59 -0
  145. package/lib/components/UI/Pagination.js.map +1 -0
  146. package/lib/components/UI/ParamSearchResultContainer.d.ts +90 -0
  147. package/lib/components/UI/ParamSearchResultContainer.d.ts.map +1 -0
  148. package/lib/components/UI/ParamSearchResultContainer.js +80 -0
  149. package/lib/components/UI/ParamSearchResultContainer.js.map +1 -0
  150. package/lib/components/UI/PropertyCard.d.ts +24 -0
  151. package/lib/components/UI/PropertyCard.d.ts.map +1 -0
  152. package/lib/components/UI/PropertyCard.js +377 -0
  153. package/lib/components/UI/PropertyCard.js.map +1 -0
  154. package/lib/components/UI/PropertyCardList.d.ts +93 -0
  155. package/lib/components/UI/PropertyCardList.d.ts.map +1 -0
  156. package/lib/components/UI/PropertyCardList.js +41 -0
  157. package/lib/components/UI/PropertyCardList.js.map +1 -0
  158. package/lib/components/UI/PropertyCardOnMap.d.ts +10 -0
  159. package/lib/components/UI/PropertyCardOnMap.d.ts.map +1 -0
  160. package/lib/components/UI/PropertyCardOnMap.js +108 -0
  161. package/lib/components/UI/PropertyCardOnMap.js.map +1 -0
  162. package/lib/components/UI/icons/LocationIcon.d.ts +7 -0
  163. package/lib/components/UI/icons/LocationIcon.d.ts.map +1 -0
  164. package/lib/components/UI/icons/LocationIcon.js +18 -0
  165. package/lib/components/UI/icons/LocationIcon.js.map +1 -0
  166. package/lib/components/UI/icons/index.d.ts +2 -0
  167. package/lib/components/UI/icons/index.d.ts.map +1 -0
  168. package/lib/components/UI/index.d.ts +8 -0
  169. package/lib/components/UI/index.d.ts.map +1 -0
  170. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +1 -1
  171. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  172. package/lib/components/index.d.ts +4 -0
  173. package/lib/components/index.d.ts.map +1 -0
  174. package/lib/components/index.js +1 -0
  175. package/lib/components/index.js.map +1 -0
  176. package/lib/components/typings.d.ts +128 -51
  177. package/lib/components/typings.d.ts.map +1 -1
  178. package/lib/compute.d.ts.map +1 -1
  179. package/lib/compute.js +5 -4
  180. package/lib/compute.js.map +1 -1
  181. package/lib/config/constants.d.ts +7 -0
  182. package/lib/config/constants.d.ts.map +1 -0
  183. package/lib/config/constants.js +6 -0
  184. package/lib/config/constants.js.map +1 -0
  185. package/lib/config/env-config.d.ts +2 -0
  186. package/lib/config/env-config.d.ts.map +1 -1
  187. package/lib/config/env-config.js +15 -1
  188. package/lib/config/env-config.js.map +1 -1
  189. package/lib/helpers/DynamicIcon.d.ts +7 -4
  190. package/lib/helpers/DynamicIcon.d.ts.map +1 -1
  191. package/lib/helpers/DynamicIcon.js +51 -0
  192. package/lib/helpers/DynamicIcon.js.map +1 -0
  193. package/lib/hooks/index.d.ts +6 -0
  194. package/lib/hooks/index.d.ts.map +1 -0
  195. package/lib/hooks/use-get-current-lat-long.d.ts +18 -0
  196. package/lib/hooks/use-get-current-lat-long.d.ts.map +1 -0
  197. package/lib/hooks/use-get-current-lat-long.js +29 -0
  198. package/lib/hooks/use-get-current-lat-long.js.map +1 -0
  199. package/lib/hooks/useMediaQuery.d.ts +14 -0
  200. package/lib/hooks/useMediaQuery.d.ts.map +1 -0
  201. package/lib/hooks/useMediaQuery.js +49 -0
  202. package/lib/hooks/useMediaQuery.js.map +1 -0
  203. package/lib/hooks/useScrollThreshold.d.ts +12 -0
  204. package/lib/hooks/useScrollThreshold.d.ts.map +1 -0
  205. package/lib/hooks/useScrollThreshold.js +60 -0
  206. package/lib/hooks/useScrollThreshold.js.map +1 -0
  207. package/lib/hooks/useTailwindTheme.d.ts +34 -0
  208. package/lib/hooks/useTailwindTheme.d.ts.map +1 -0
  209. package/lib/hooks/useTailwindTheme.js +82 -0
  210. package/lib/hooks/useTailwindTheme.js.map +1 -0
  211. package/lib/hooks/useWindowSize.d.ts +6 -0
  212. package/lib/hooks/useWindowSize.d.ts.map +1 -0
  213. package/lib/hooks/useWindowSize.js +20 -0
  214. package/lib/hooks/useWindowSize.js.map +1 -0
  215. package/lib/icons.d.ts +2 -0
  216. package/lib/icons.d.ts.map +1 -1
  217. package/lib/icons.js +4 -2
  218. package/lib/icons.js.map +1 -1
  219. package/lib/index.d.ts +2 -0
  220. package/lib/index.d.ts.map +1 -1
  221. package/lib/index.js +1 -1
  222. package/lib/index.js.map +1 -1
  223. package/lib/machines/settingsMachine.d.ts +4 -1
  224. package/lib/machines/settingsMachine.d.ts.map +1 -1
  225. package/lib/machines/settingsMachine.js +173 -67
  226. package/lib/machines/settingsMachine.js.map +1 -1
  227. package/lib/machines/types.d.ts +117 -17
  228. package/lib/machines/types.d.ts.map +1 -1
  229. package/lib/machines/types.js +5 -0
  230. package/lib/machines/types.js.map +1 -0
  231. package/lib/module.d.ts +0 -1
  232. package/lib/module.d.ts.map +1 -1
  233. package/lib/module.js +12 -14
  234. package/lib/module.js.map +1 -1
  235. package/lib/tailwindConfig.d.ts +42 -0
  236. package/lib/tailwindConfig.d.ts.map +1 -0
  237. package/lib/tailwindConfig.js +23 -0
  238. package/lib/tailwindConfig.js.map +1 -0
  239. package/package.json +4 -4
  240. package/lib/components/Layout/GlobalFooter/Copyright.js +0 -8
  241. package/lib/components/Layout/GlobalFooter/Copyright.js.map +0 -1
  242. package/lib/components/Layout/GlobalFooter/Footer.js +0 -22
  243. package/lib/components/Layout/GlobalFooter/Footer.js.map +0 -1
  244. package/lib/components/ThemeProvider/themeRegistry.d.ts +0 -3
  245. package/lib/components/ThemeProvider/themeRegistry.d.ts.map +0 -1
  246. package/lib/components/ThemeProvider/themeRegistry.js +0 -388
  247. package/lib/components/ThemeProvider/themeRegistry.js.map +0 -1
  248. package/lib/components/ThemeProvider/themeUtils.d.ts +0 -26
  249. package/lib/components/ThemeProvider/themeUtils.d.ts.map +0 -1
  250. package/lib/components/ThemeProvider/themeUtils.js +0 -135
  251. package/lib/components/ThemeProvider/themeUtils.js.map +0 -1
  252. package/lib/components/defaultSettings.d.ts +0 -4
  253. package/lib/components/defaultSettings.d.ts.map +0 -1
  254. package/lib/components/defaultSettings.js +0 -14
  255. package/lib/components/defaultSettings.js.map +0 -1
@@ -0,0 +1,80 @@
1
+ import {jsxs,jsx}from'react/jsx-runtime';import {useEffect}from'react';import {useTranslation}from'react-i18next';import {PropertyCardList}from'./PropertyCardList.js';import {Pagination}from'./Pagination.js';const ParamSearchResultContainer = props => {
2
+ const {
3
+ data,
4
+ error,
5
+ currentPage,
6
+ totalPropertiesCount,
7
+ totalPages,
8
+ onPageChange,
9
+ handleSetFocus,
10
+ handleRemoveFocus,
11
+ handleLike,
12
+ likeBtnLoading,
13
+ propertyTypes,
14
+ extraIcons
15
+ } = props;
16
+ const {
17
+ t
18
+ } = useTranslation(['common']);
19
+ useEffect(() => {
20
+ if (error) {
21
+ // Create a tailwind toast notification
22
+ const toastDiv = document.createElement('div');
23
+ toastDiv.className = 'fixed top-4 right-4 z-50 w-96 rounded-lg bg-red-50 border border-red-400 p-4 shadow-md';
24
+ toastDiv.innerHTML = `
25
+ <div class="flex justify-between">
26
+ <div class="flex">
27
+ <div class="mr-2 text-red-400">
28
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
29
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
30
+ </svg>
31
+ </div>
32
+ <div>
33
+ <p class="font-medium text-red-800">${t('property.something_went_wrong')}</p>
34
+ <p class="text-sm text-red-800">${error.message}</p>
35
+ </div>
36
+ </div>
37
+ <button class="text-red-800 hover:bg-gray-100 rounded-full p-1" onclick="this.parentElement.parentElement.remove()">
38
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
39
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
40
+ </svg>
41
+ </button>
42
+ </div>
43
+ `;
44
+ document.body.appendChild(toastDiv);
45
+ setTimeout(() => {
46
+ toastDiv.remove();
47
+ }, 5000);
48
+ }
49
+ }, [error]);
50
+ return jsxs("div", {
51
+ className: "flex flex-col self-stretch relative w-full px-3 sm:px-5 lg:px-7",
52
+ children: [jsx("div", {
53
+ className: "text-lg font-semibold",
54
+ children: t('property.results_on')
55
+ }), jsx("div", {
56
+ className: "text-2xl font-bold",
57
+ children: jsx("span", {
58
+ className: "text-lg ml-5",
59
+ children: t('property.results', {
60
+ totalCount: totalPropertiesCount
61
+ })
62
+ })
63
+ }), jsx(PropertyCardList, {
64
+ rooms: data,
65
+ setFocus: handleSetFocus,
66
+ setBlur: handleRemoveFocus,
67
+ handleLike: handleLike,
68
+ likeBtnLoading: likeBtnLoading,
69
+ propertyTypes: propertyTypes,
70
+ extraIcons: extraIcons
71
+ }), totalPages > 1 && jsx("div", {
72
+ className: "mt-8 mb-8",
73
+ children: jsx(Pagination, {
74
+ currentPage: currentPage,
75
+ totalPages: totalPages,
76
+ onPageChange: onPageChange
77
+ })
78
+ })]
79
+ });
80
+ };export{ParamSearchResultContainer};//# sourceMappingURL=ParamSearchResultContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParamSearchResultContainer.js","sources":["../../../src/components/UI/ParamSearchResultContainer.tsx"],"sourcesContent":[null],"names":[],"mappings":"gNA2Ga,MAAA,0BAA0B,GAAG,KAAC,IAAsC;QACvE;IAeN,IAAM;IAEN,KAAS;eACD;wBACuC;cACjC;AACN,IAAA,YAAA;AACI,IAAA,cAAA;qBACK;;;;;;;;;;AAUyC,IAAA,IAAA,KAAA,EAAA;;;;;;;;;;AAUlD;;;gEAIS,EAAA,CAAA,CAAA,+BAAA,CAAA,CAAA;4DACZ,EAAA,KAAA,CAAA,OAAA,CAAA;AACL;;AAwBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ interface IPropertyType {
3
+ id: string;
4
+ icon: string;
5
+ description: string;
6
+ category: string;
7
+ name: string;
8
+ imageKey: string;
9
+ created_at: string;
10
+ }
11
+ type PropertyCardProps = {
12
+ room: any;
13
+ isSaved: boolean;
14
+ setFocus: (index: number) => void;
15
+ setBlur: (index: number) => void;
16
+ handleLike: (index: number) => void;
17
+ authenticated: boolean;
18
+ likeBtnLoading: boolean;
19
+ propertyTypes: IPropertyType[];
20
+ extraIcons: any[];
21
+ };
22
+ export declare const PropertyCard: ({ room, isSaved, setFocus, setBlur, handleLike, likeBtnLoading, propertyTypes, authenticated, extraIcons, ...props }: PropertyCardProps & React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
23
+ export {};
24
+ //# sourceMappingURL=PropertyCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyCard.d.ts","sourceRoot":"","sources":["../../../src/components/UI/PropertyCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAezE,UAAU,aAAa;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,UAAU,EAAE,GAAG,EAAE,CAAC;CACrB,CAAC;AAgEF,eAAO,MAAM,YAAY,yHAWtB,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,4CA0W1D,CAAC"}
@@ -0,0 +1,377 @@
1
+ import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useMemo,useState,useEffect,useCallback}from'react';import {BsHeart}from'@react-icons/all-files/bs/BsHeart.js';import {BsStarFill}from'@react-icons/all-files/bs/BsStarFill.js';import {FaUserAlt}from'@react-icons/all-files/fa/FaUserAlt.js';import {useTranslation}from'react-i18next';import {WithAuthentication}from'@adminide-stack/user-auth0-browser-chakra/lib/index.component.js';import {Splide,SplideSlide}from'@cdmbase/react-splide';import {useLocation}from'@remix-run/react';import {format}from'date-fns';import {startCase}from'lodash-es';import {useTailwindTheme}from'../../hooks/useTailwindTheme.js';import {useGetCurrentLongLat}from'../../hooks/use-get-current-lat-long.js';import {LocationIcon}from'./icons/LocationIcon.js';import {renderDynamicIcon}from'../../helpers/DynamicIcon.js';import {config}from'../../config/env-config.js';const convertHotelName = name => {
2
+ return name.toLowerCase().replace(/[^a-z0-9\s-]/g, '').replace(/[\s-]+/g, '-').replace(/-+/g, '-');
3
+ };
4
+ const generateHref = (room, from, to, adults, children) => {
5
+ switch (room.__typename) {
6
+ case 'AirbnbProperty':
7
+ return `https://www.airbnb.com/rooms/${room.id}?check_in=${from}&check_out=${to}&guests=${adults + children || 1}`;
8
+ case 'BookingProperty':
9
+ return `https://www.booking.com/hotel/${room.address.city.state.country.id}/${convertHotelName(room.name)}.html`;
10
+ case 'PricelineProperty':
11
+ const propertyId = room.metadata?.id_t;
12
+ const cityId = room?.metadata?.city?.id || '';
13
+ const checkInDate = typeof from === 'string' ? from : format(new Date(from), 'yyyyMMdd');
14
+ const checkOutDate = typeof to === 'string' ? to : format(new Date(to), 'yyyyMMdd');
15
+ const roomCount = 1;
16
+ const adultCount = adults || 1;
17
+ return `https://www.priceline.com/relax/at/${propertyId}/from/${checkInDate}/to/${checkOutDate}/rooms/${roomCount}/adults/${adultCount}?cityId=${cityId}&cur=USD&psl=${propertyId}`;
18
+ default:
19
+ return `/property/${room.id}`;
20
+ }
21
+ };
22
+ const DealCard = ({
23
+ site,
24
+ price
25
+ }) => jsxs("div", {
26
+ className: "flex flex-col items-center p-2 rounded-md",
27
+ children: [jsx("span", {
28
+ className: "text-xs font-bold text-gray-700",
29
+ children: site
30
+ }), jsx("span", {
31
+ className: "text-base font-bold text-black",
32
+ children: typeof price === 'number' ? price.toLocaleString() : price
33
+ })]
34
+ });
35
+ function calculateDuration(checkIn, checkOut) {
36
+ const checkInDate = new Date(checkIn);
37
+ const checkOutDate = new Date(checkOut);
38
+ const duration = Math.ceil((checkOutDate.getTime() - checkInDate.getTime()) / (1000 * 60 * 60 * 24));
39
+ return duration;
40
+ }
41
+ function formatDuration(days) {
42
+ if (days < 7) {
43
+ return `${days} ${days === 1 ? 'day' : 'days'}`;
44
+ } else {
45
+ const weeks = Math.floor(days / 7);
46
+ const remainingDays = days % 7;
47
+ let result = `${weeks} ${weeks === 1 ? 'week' : 'weeks'}`;
48
+ if (remainingDays > 0) {
49
+ result += `, ${remainingDays} ${remainingDays === 1 ? 'day' : 'days'}`;
50
+ }
51
+ return result;
52
+ }
53
+ }
54
+ const PropertyCard = ({
55
+ room,
56
+ isSaved,
57
+ setFocus,
58
+ setBlur,
59
+ handleLike,
60
+ likeBtnLoading,
61
+ propertyTypes,
62
+ authenticated,
63
+ extraIcons = [],
64
+ ...props
65
+ }) => {
66
+ const images = useMemo(() => room?.images?.data.map(({
67
+ url
68
+ }) => ({
69
+ src: url
70
+ })), [room]);
71
+ const [didLike, setDidLike] = useState(false);
72
+ useMemo(() => room?.totalReview == 0 ? 0 : room?.totalStar / room?.totalReview || 0, [room]);
73
+ const {
74
+ isDark,
75
+ grayColor
76
+ } = useTailwindTheme();
77
+ const {
78
+ t
79
+ } = useTranslation(['common', 'property-types']);
80
+ const types = useMemo(() => propertyTypes.filter(item => room?.types?.includes(item.id)), [room, propertyTypes]);
81
+ const {
82
+ fetchCurrentLatLong,
83
+ location,
84
+ loading
85
+ } = useGetCurrentLongLat();
86
+ const locationUrl = useLocation();
87
+ const params = new URLSearchParams(locationUrl.search);
88
+ const checkIn = params.get('checkIn') || params.get('from') || '';
89
+ const checkOut = params.get('checkOut') || params.get('to') || '';
90
+ const duration = calculateDuration(checkIn, checkOut);
91
+ const formattedDuration = formatDuration(duration);
92
+ useEffect(() => {
93
+ fetchCurrentLatLong();
94
+ }, []);
95
+ const getPriceType = useCallback(room => {
96
+ const type = room.preferences?.property?.pricing?.option?.priceType;
97
+ if (type === 'HOUR') {
98
+ return t('property.hr');
99
+ }
100
+ return t('property.night');
101
+ }, [t]);
102
+ useCallback(address => {
103
+ if (!location || !address) return null;
104
+ if (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.LatLng) {
105
+ const point1 = new window.google.maps.LatLng(location.latitude, location.longitude);
106
+ const point2 = new window.google.maps.LatLng(address.latitude_around, address.longitude_around);
107
+ if (window.google.maps.geometry && window.google.maps.geometry.spherical) {
108
+ const distance = window.google.maps.geometry.spherical.computeDistanceBetween(point1, point2);
109
+ const distanceInMiles = distance * 0.000621371;
110
+ return Math.floor(distanceInMiles);
111
+ } else {
112
+ console.error('Google Maps geometry library is not loaded.');
113
+ return null;
114
+ }
115
+ } else {
116
+ return null;
117
+ }
118
+ }, [location]);
119
+ const searchParams = new URLSearchParams(window.location.search);
120
+ const adults = parseInt(searchParams.get('adults') || '0', 10) || 1;
121
+ const children = parseInt(searchParams.get('children') || '0', 10);
122
+ const amenities = room?.preferences?.property?.amenities;
123
+ const displayedIcons = amenities ? Object.entries(amenities).flatMap(([key, value]) => {
124
+ const enabledAmenities = Object.entries(value ?? {}).filter(([key1, value1]) => value1?.enable && value1?.icon);
125
+ const displayedAmenities = enabledAmenities.slice(0, 8);
126
+ return displayedAmenities.length > 0 ? displayedAmenities.map(([key1, value1]) => renderDynamicIcon({
127
+ name: value1.icon,
128
+ style: {
129
+ iconColor: grayColor,
130
+ w: '20px',
131
+ h: '20px'
132
+ }
133
+ })) : [];
134
+ }) : [];
135
+ const LikeButton = () => jsx(Fragment, {
136
+ children: likeBtnLoading ? jsx("div", {
137
+ className: "w-12 h-12 border-4 border-t-blue-500 rounded-full animate-spin border-gray-200"
138
+ }) : jsx("button", {
139
+ className: `w-7 h-9.5 rounded-full flex items-center justify-center ${didLike ? 'bg-blue-400' : isDark ? 'bg-gray-800' : 'bg-white'}`,
140
+ onClick: () => handleLike(room.id),
141
+ "aria-label": "Select as your favourite",
142
+ children: jsx(BsHeart, {
143
+ className: isDark ? 'text-white' : 'text-gray-800'
144
+ })
145
+ })
146
+ });
147
+ WithAuthentication(LikeButton);
148
+ return jsx(Fragment, {
149
+ children: jsxs("div", {
150
+ className: "flex flex-row p-2 relative",
151
+ onMouseEnter: () => setFocus(room.id),
152
+ onMouseLeave: () => setBlur(room.id),
153
+ ...props,
154
+ children: [room.status === 'pending' && jsxs(Fragment, {
155
+ children: [jsx("div", {
156
+ className: "absolute w-full h-full bg-black bg-opacity-60 rounded-2xl z-10"
157
+ }), jsx("div", {
158
+ className: "absolute left-1/2 top-1/2 transform -translate-x-1/2 translate-y-1/2 text-white z-20",
159
+ children: jsx("p", {
160
+ className: "text-lg font-normal",
161
+ children: t('property.coming_soon')
162
+ })
163
+ })]
164
+ }), jsx("div", {
165
+ className: "w-full max-w-[350px] border border-solid border-gray-200 rounded-2xl overflow-hidden shadow-md transition-all duration-300 hover:transform hover:-translate-y-1 hover:shadow-lg",
166
+ children: jsxs("div", {
167
+ className: "w-full h-full flex flex-col justify-between space-y-4",
168
+ children: [jsxs("div", {
169
+ className: "relative w-full h-full rounded-xl",
170
+ children: [jsx("div", {
171
+ className: "absolute top-2 left-2 bg-green-600 text-white px-3 py-1 rounded-md text-sm font-bold shadow-md z-10",
172
+ children: "Breakfast included"
173
+ }), jsxs(Splide, {
174
+ "aria-label": "Property Images",
175
+ options: {
176
+ type: 'slide',
177
+ drag: 'free',
178
+ perPage: 1,
179
+ perMove: 1,
180
+ lazyLoad: 'sequential',
181
+ wheel: true,
182
+ releaseWheel: true,
183
+ pagination: false,
184
+ speed: 800
185
+ },
186
+ children: [jsx("div", {
187
+ className: "absolute top-2.5 right-2.5 z-10",
188
+ children: jsx(LikeButton, {})
189
+ }), images.map((image, i) => jsx(SplideSlide, {
190
+ children: jsx("a", {
191
+ href: generateHref(room, checkIn, checkOut, adults, children),
192
+ target: "_blank",
193
+ rel: "noopener noreferrer",
194
+ children: jsx("div", {
195
+ className: "w-full h-full rounded-xl",
196
+ children: jsx("img", {
197
+ src: image.src,
198
+ className: "rounded-xl h-[250px] w-full max-w-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
199
+ loading: "lazy",
200
+ alt: `Property ${i + 1}`
201
+ }, 'image_' + i)
202
+ }, 'sliderImage_' + i)
203
+ })
204
+ }, 'sliderslide_' + i))]
205
+ })]
206
+ }), jsxs("div", {
207
+ className: "w-full px-4 flex flex-col pt-2",
208
+ children: [jsxs("div", {
209
+ className: "flex flex-wrap items-center space-x-2 mb-2",
210
+ children: [jsxs("span", {
211
+ className: "text-sm font-medium",
212
+ children: [t('property.property_type'), ":"]
213
+ }), types?.map((item, index) => jsx("span", {
214
+ className: "bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded-full capitalize",
215
+ children: t(`property-types:${item.description}`)
216
+ }, index))]
217
+ }), jsx("h3", {
218
+ className: "text-lg font-medium mb-2 line-clamp-2",
219
+ children: room?.title
220
+ }), room?.address && room?.address.city && room?.address.city.state && jsxs("div", {
221
+ className: "flex items-center text-sm text-gray-500 mb-2",
222
+ children: [jsx(LocationIcon, {
223
+ w: "16px",
224
+ h: "20px"
225
+ }), jsxs("span", {
226
+ className: "truncate",
227
+ children: [room?.address.city.name + ', ' + room?.address.city.state.name, room?.address?.number ? ' · ' + room?.address?.number : '']
228
+ })]
229
+ }), displayedIcons.length > 0 && jsx("div", {
230
+ className: "flex space-x-3 mt-2 mb-3",
231
+ children: displayedIcons
232
+ }), jsxs("div", {
233
+ className: "flex flex-wrap space-x-2 mt-1 mb-3",
234
+ children: [room?.preferences?.property?.booking?.policy?.instantBookingEnabled && jsx("span", {
235
+ className: "bg-blue-100 text-blue-800 px-2 py-1 rounded-md text-xs capitalize",
236
+ children: t('property.instant_book')
237
+ }), room?.preferences?.property?.booking?.policy?.cancellation && jsx("span", {
238
+ className: "bg-green-100 text-green-800 px-2 py-1 rounded-md text-xs capitalize",
239
+ children: t('property.cancellation_policy')
240
+ })]
241
+ }), jsxs("div", {
242
+ className: "flex items-center mb-4",
243
+ children: [jsx(FaUserAlt, {
244
+ className: "text-gray-500"
245
+ }), jsxs("span", {
246
+ className: "text-sm text-gray-600 ml-2",
247
+ children: [room?.preferences?.property?.boarding?.maxPeople, " ", t('property.guests')]
248
+ })]
249
+ })]
250
+ }), config.ENABLE_PROPERTY_PRICE_COMPARISON && jsx("div", {
251
+ className: "px-4 w-full",
252
+ children: jsxs("div", {
253
+ className: "w-fit flex gap-4",
254
+ children: [jsx("hr", {
255
+ className: "w-full border-t border-gray-200"
256
+ }), jsxs("div", {
257
+ className: "flex flex-row",
258
+ children: [jsx(DealCard, {
259
+ site: "Vio.com",
260
+ price: 41387
261
+ }), jsx(DealCard, {
262
+ site: "Expedia.com",
263
+ price: 46369
264
+ }), jsx(DealCard, {
265
+ site: "More Deals",
266
+ price: 'View all'
267
+ })]
268
+ }), jsx("hr", {
269
+ className: "w-full border-t border-gray-200"
270
+ })]
271
+ })
272
+ }), jsxs("div", {
273
+ className: "flex flex-col sm:flex-row px-4 pb-4 w-full justify-between items-start sm:items-center",
274
+ children: [jsxs("div", {
275
+ className: "flex flex-col space-y-1 mb-3 sm:mb-0 w-full sm:w-auto",
276
+ children: [jsxs("div", {
277
+ className: "flex items-center",
278
+ children: [jsx(BsStarFill, {
279
+ className: "text-yellow-500 w-3 h-3 mr-1"
280
+ }), jsxs("span", {
281
+ className: "text-[0.832rem] font-bold text-gray-600",
282
+ children: [room?.reviewsOverview ? room.reviewsOverview.rating : 0, " (", room.reviewsOverview ? room.reviewsOverview.ratingCount : 0, ' ', t('property.reviews'), ")"]
283
+ })]
284
+ }), room?.__typename && jsxs("span", {
285
+ className: "text-[0.832rem] text-gray-500",
286
+ children: ["Booking through ", startCase(room.__typename.replace('Property', ''))]
287
+ })]
288
+ }), jsxs("div", {
289
+ className: "flex flex-col items-end space-y-2 w-full sm:w-auto",
290
+ children: [jsxs("div", {
291
+ className: "flex flex-col items-end space-y-1 w-full",
292
+ children: [jsxs("span", {
293
+ className: "text-[0.688rem] text-gray-500 text-right w-full",
294
+ children: [formattedDuration, ", ", adults + children, ' ', adults + children === 1 ? 'guest' : 'guests']
295
+ }), jsxs("div", {
296
+ className: "flex flex-col items-end space-y-0 w-full",
297
+ children: [room.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.total !== room.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount && jsxs("div", {
298
+ className: "flex items-center group relative",
299
+ children: [jsx("span", {
300
+ className: "text-xs text-gray-500",
301
+ children: "from"
302
+ }), jsx("span", {
303
+ className: "text-sm font-semibold text-gray-500 line-through ml-1 cursor-help hover:text-gray-600 group-hover:text-gray-600",
304
+ children: room.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount
305
+ }), jsx("div", {
306
+ className: "hidden group-hover:block absolute top-0 right-0 transform -translate-y-full mt-2 w-[300px] shadow-lg bg-white rounded-md p-4 z-50",
307
+ children: jsxs("div", {
308
+ className: "flex flex-col space-y-2",
309
+ children: [room.preferences?.property?.pricing?.price?.price_breakdown?.details?.discounts?.items.map((charge, index) => jsxs("div", {
310
+ className: "flex flex-col",
311
+ children: [jsxs("div", {
312
+ className: "flex justify-between",
313
+ children: [jsx("span", {
314
+ className: "mr-4",
315
+ children: charge.name
316
+ }), jsx("span", {
317
+ className: "font-medium",
318
+ children: charge?.amount_rounded
319
+ })]
320
+ }), charge.details && jsx("span", {
321
+ className: "text-sm font-normal",
322
+ children: charge?.details
323
+ })]
324
+ }, index)), jsxs("div", {
325
+ className: "flex justify-between pt-2 border-t border-gray-200 font-bold",
326
+ children: [jsx("span", {
327
+ children: "Total discount"
328
+ }), jsx("span", {
329
+ children: room.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.savings
330
+ })]
331
+ })]
332
+ })
333
+ })]
334
+ }), jsxs("div", {
335
+ className: "relative group",
336
+ children: [jsx("span", {
337
+ className: "text-2xl font-semibold text-right underline cursor-help",
338
+ children: room.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.total
339
+ }), jsxs("div", {
340
+ className: "hidden group-hover:block absolute bottom-0 right-0 transform translate-y-full mt-2 w-[300px] shadow-lg bg-white rounded-md z-50",
341
+ children: [jsx("div", {
342
+ className: "font-bold border-b border-gray-200 p-3 text-center",
343
+ children: "Price breakdown"
344
+ }), jsx("div", {
345
+ className: "p-4",
346
+ children: jsx("div", {
347
+ className: "flex flex-col space-y-2",
348
+ children: room.preferences?.property?.pricing?.price?.price_breakdown?.details?.charges?.items?.map((item, index) => jsxs("div", {
349
+ className: "flex justify-between",
350
+ children: [jsx("span", {
351
+ children: item.name
352
+ }), jsx("span", {
353
+ children: item?.amount_rounded
354
+ })]
355
+ }, index))
356
+ })
357
+ })]
358
+ })]
359
+ })]
360
+ }), jsxs("span", {
361
+ className: "text-xs text-gray-500 text-right w-full",
362
+ children: [room?.preferences?.property?.pricing?.price?.price_breakdown?.details?.pricing?.basePrice?.perNight, ' ', "per ", getPriceType(room)]
363
+ })]
364
+ }), jsx("button", {
365
+ className: "bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded w-full",
366
+ onClick: () => {
367
+ window.open(generateHref(room, checkIn, checkOut, adults, children), '_blank');
368
+ },
369
+ children: "View deal"
370
+ })]
371
+ })]
372
+ })]
373
+ })
374
+ })]
375
+ }, room.id)
376
+ });
377
+ };export{PropertyCard};//# sourceMappingURL=PropertyCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyCard.js","sources":["../../../src/components/UI/PropertyCard.ts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AA,CAAE,IAAK,EAAA,MAAA,CAAA,KAAA,MAAA,EAAA,MAAA,IAAA,MAAA,EAAA,IAAA,CAAA;;AAEH,IAAA,OAAA,kBAAA,CAAA,MAAA,GAAA,CAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,IAAS,EAAA,MAAqB,CAAA,KAAA,iBAClC,CAAA;;AAgC4B,MAAA,KAAA,EAAA;;;AAkDhC,QAAA,CAAA,EAAA;AACJ;AAWpC,KAAE,CAAA,CAAA,GAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ interface IProperty {
3
+ id: string;
4
+ title: string;
5
+ types: string[];
6
+ name: string;
7
+ description?: string;
8
+ introduction?: string;
9
+ address: any;
10
+ location: string;
11
+ images: any;
12
+ thumbnailUrl?: string;
13
+ thumbnailAlt?: string;
14
+ verificationDocuments?: any;
15
+ info?: any;
16
+ user: any;
17
+ status?: any;
18
+ errors?: any;
19
+ preferences?: any;
20
+ orgName?: string;
21
+ serviceConfiguration?: any;
22
+ totalReview?: number;
23
+ totalStar?: number;
24
+ reviews?: any;
25
+ comments?: any;
26
+ userLikes?: any;
27
+ calendarEvents?: any[];
28
+ isUserLike?: boolean;
29
+ formattedPrice?: number;
30
+ timeZone: string;
31
+ createdAt: any;
32
+ updatedAt?: any;
33
+ stats?: any;
34
+ guideBookId?: string;
35
+ guestSharing?: any;
36
+ }
37
+ interface IAirbnbProperty {
38
+ id: string;
39
+ title: string;
40
+ types: string[];
41
+ name: string;
42
+ description?: string;
43
+ introduction?: string;
44
+ address: any;
45
+ location: string;
46
+ images: any;
47
+ thumbnailUrl?: string;
48
+ thumbnailAlt?: string;
49
+ verificationDocuments?: any;
50
+ info?: any;
51
+ user: any;
52
+ status?: any;
53
+ errors?: any;
54
+ preferences?: any;
55
+ orgName?: string;
56
+ serviceConfiguration?: any;
57
+ totalReview?: number;
58
+ totalStar?: number;
59
+ reviews?: any;
60
+ comments?: any;
61
+ userLikes?: any;
62
+ calendarEvents?: any[];
63
+ isUserLike?: boolean;
64
+ formattedPrice?: number;
65
+ timeZone: string;
66
+ createdAt: any;
67
+ updatedAt?: any;
68
+ stats?: any;
69
+ guideBookId?: string;
70
+ guestSharing?: any;
71
+ }
72
+ interface IPropertyType {
73
+ id: string;
74
+ icon: string;
75
+ description: string;
76
+ category: string;
77
+ name: string;
78
+ imageKey: string;
79
+ created_at: string;
80
+ }
81
+ type PropertyCardListProps = {
82
+ rooms?: IProperty[] | IAirbnbProperty[];
83
+ setFocus: (index: number) => void;
84
+ setBlur: (index: number) => void;
85
+ handleLike: (index: number) => void;
86
+ likeBtnLoading: boolean;
87
+ propertyTypes: IPropertyType[];
88
+ extraIcons?: any;
89
+ className?: string;
90
+ };
91
+ export declare const PropertyCardList: React.FC<PropertyCardListProps>;
92
+ export {};
93
+ //# sourceMappingURL=PropertyCardList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyCardList.d.ts","sourceRoot":"","sources":["../../../src/components/UI/PropertyCardList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,SAAS;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ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,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA6B5D,CAAC"}
@@ -0,0 +1,41 @@
1
+ import {jsx}from'react/jsx-runtime';import {useTranslation}from'react-i18next';import {isEmpty}from'lodash-es';import {PropertyCard}from'./PropertyCard.js';import {isUserAuthenticated}from'@adminide-stack/user-auth0-client';const PropertyCardList = props => {
2
+ // rooms = defaultRooms;
3
+ const {
4
+ setBlur,
5
+ setFocus,
6
+ rooms,
7
+ handleLike,
8
+ likeBtnLoading,
9
+ propertyTypes,
10
+ extraIcons,
11
+ className = ''
12
+ } = props;
13
+ const {
14
+ t
15
+ } = useTranslation();
16
+ const {
17
+ authenticated
18
+ } = isUserAuthenticated();
19
+ if (isEmpty(rooms)) {
20
+ return jsx("div", {
21
+ className: "text-base",
22
+ children: t('property.not_found_any_room')
23
+ });
24
+ }
25
+ return jsx("div", {
26
+ className: `flex flex-wrap justify-evenly ${className}`,
27
+ children: rooms?.map((r, index) => {
28
+ return jsx(PropertyCard, {
29
+ room: r,
30
+ isSaved: false,
31
+ setFocus: () => setFocus(index),
32
+ setBlur: setBlur,
33
+ handleLike: handleLike,
34
+ likeBtnLoading: likeBtnLoading,
35
+ propertyTypes: propertyTypes,
36
+ authenticated: authenticated,
37
+ extraIcons: extraIcons
38
+ }, index);
39
+ })
40
+ });
41
+ };export{PropertyCardList};//# sourceMappingURL=PropertyCardList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyCardList.js","sources":["../../../src/components/UI/PropertyCardList.tsx"],"sourcesContent":[null],"names":[],"mappings":"gOAiGa,MAAA,gBAAgB,GAAoC,KAAC,IAAS;;QAEjE;AACN,IAAA;AACA,IAAA,QAAQ;AAER,IAAA,KAAW;cACA;IACX,cAAC;AACD,IAAA,aACS;cAEU;aAeT,GACR;AACN,GAAE,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Options } from '@cdmbase/react-splide';
2
+ type PropertyCardOnMapProps = {
3
+ room: any;
4
+ isSaved: boolean;
5
+ sliderOptions?: Options;
6
+ className?: string;
7
+ };
8
+ export declare const PropertyCardOnMap: ({ room, isSaved, sliderOptions, className, ...props }: PropertyCardOnMapProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=PropertyCardOnMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyCardOnMap.d.ts","sourceRoot":"","sources":["../../../src/components/UI/PropertyCardOnMap.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAIrE,KAAK,sBAAsB,GAAG;IAC1B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,0DAM3B,sBAAsB,4CA0FxB,CAAC"}