@inorain_development/hotel-smarters-chat-ui 1.2.2 → 1.3.1
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.
- package/lib/commonjs/features/chat/components/common/calendar-icon.js +33 -0
- package/lib/commonjs/features/chat/components/common/calendar-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/calendar-icon.native.js +33 -0
- package/lib/commonjs/features/chat/components/common/calendar-icon.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/cart-icon.js +36 -0
- package/lib/commonjs/features/chat/components/common/cart-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.js +26 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.native.js +26 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.js +23 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.native.js +23 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.js +130 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.native.js +132 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight.js +149 -0
- package/lib/commonjs/features/chat/components/flight/flight.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight.model.js +6 -0
- package/lib/commonjs/features/chat/components/flight/flight.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight.native.js +151 -0
- package/lib/commonjs/features/chat/components/flight/flight.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/index.js +13 -0
- package/lib/commonjs/features/chat/components/flight/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.js +154 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.model.js +6 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.native.js +165 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/index.js +13 -0
- package/lib/commonjs/features/chat/components/flight-board/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/info/info.js +41 -14
- package/lib/commonjs/features/chat/components/info/info.js.map +1 -1
- package/lib/commonjs/features/chat/components/info/info.native.js +45 -14
- package/lib/commonjs/features/chat/components/info/info.native.js.map +1 -1
- package/lib/commonjs/features/chat/components/order/index.js +20 -0
- package/lib/commonjs/features/chat/components/order/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/order/order.js +168 -0
- package/lib/commonjs/features/chat/components/order/order.js.map +1 -0
- package/lib/commonjs/features/chat/components/order/order.model.js +15 -0
- package/lib/commonjs/features/chat/components/order/order.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/order/order.native.js +186 -0
- package/lib/commonjs/features/chat/components/order/order.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/index.js +20 -0
- package/lib/commonjs/features/chat/components/reservation/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.js +165 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.model.js +13 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.native.js +180 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.native.js.map +1 -0
- package/lib/commonjs/features/chat/model/chat.model.js +17 -1
- package/lib/commonjs/features/chat/model/chat.model.js.map +1 -1
- package/lib/commonjs/features/chat/renderer/renderer.js +26 -0
- package/lib/commonjs/features/chat/renderer/renderer.js.map +1 -1
- package/lib/commonjs/features/chat/renderer/renderer.native.js +26 -0
- package/lib/commonjs/features/chat/renderer/renderer.native.js.map +1 -1
- package/lib/commonjs/native.js +48 -0
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/utils/flight.utils.js +86 -0
- package/lib/commonjs/utils/flight.utils.js.map +1 -0
- package/lib/commonjs/utils/order.utils.js +24 -0
- package/lib/commonjs/utils/order.utils.js.map +1 -0
- package/lib/commonjs/utils/reservation.utils.js +22 -0
- package/lib/commonjs/utils/reservation.utils.js.map +1 -0
- package/lib/commonjs/utils/status-badge.utils.js +75 -0
- package/lib/commonjs/utils/status-badge.utils.js.map +1 -0
- package/lib/commonjs/utils/theme.utils.js +8 -2
- package/lib/commonjs/utils/theme.utils.js.map +1 -1
- package/lib/commonjs/web.js +48 -0
- package/lib/commonjs/web.js.map +1 -1
- package/lib/module/features/chat/components/common/calendar-icon.js +29 -0
- package/lib/module/features/chat/components/common/calendar-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/calendar-icon.native.js +29 -0
- package/lib/module/features/chat/components/common/calendar-icon.native.js.map +1 -0
- package/lib/module/features/chat/components/common/cart-icon.js +32 -0
- package/lib/module/features/chat/components/common/cart-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/chevron-icon.js +22 -0
- package/lib/module/features/chat/components/common/chevron-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/chevron-icon.native.js +22 -0
- package/lib/module/features/chat/components/common/chevron-icon.native.js.map +1 -0
- package/lib/module/features/chat/components/common/plane-icon.js +19 -0
- package/lib/module/features/chat/components/common/plane-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/plane-icon.native.js +19 -0
- package/lib/module/features/chat/components/common/plane-icon.native.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight-card.js +126 -0
- package/lib/module/features/chat/components/flight/flight-card.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight-card.native.js +128 -0
- package/lib/module/features/chat/components/flight/flight-card.native.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight.js +145 -0
- package/lib/module/features/chat/components/flight/flight.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight.model.js +4 -0
- package/lib/module/features/chat/components/flight/flight.model.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight.native.js +147 -0
- package/lib/module/features/chat/components/flight/flight.native.js.map +1 -0
- package/lib/module/features/chat/components/flight/index.js +4 -0
- package/lib/module/features/chat/components/flight/index.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/flight-board.js +150 -0
- package/lib/module/features/chat/components/flight-board/flight-board.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/flight-board.model.js +4 -0
- package/lib/module/features/chat/components/flight-board/flight-board.model.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/flight-board.native.js +161 -0
- package/lib/module/features/chat/components/flight-board/flight-board.native.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/index.js +4 -0
- package/lib/module/features/chat/components/flight-board/index.js.map +1 -0
- package/lib/module/features/chat/components/info/info.js +41 -14
- package/lib/module/features/chat/components/info/info.js.map +1 -1
- package/lib/module/features/chat/components/info/info.native.js +46 -15
- package/lib/module/features/chat/components/info/info.native.js.map +1 -1
- package/lib/module/features/chat/components/order/index.js +5 -0
- package/lib/module/features/chat/components/order/index.js.map +1 -0
- package/lib/module/features/chat/components/order/order.js +164 -0
- package/lib/module/features/chat/components/order/order.js.map +1 -0
- package/lib/module/features/chat/components/order/order.model.js +11 -0
- package/lib/module/features/chat/components/order/order.model.js.map +1 -0
- package/lib/module/features/chat/components/order/order.native.js +182 -0
- package/lib/module/features/chat/components/order/order.native.js.map +1 -0
- package/lib/module/features/chat/components/reservation/index.js +5 -0
- package/lib/module/features/chat/components/reservation/index.js.map +1 -0
- package/lib/module/features/chat/components/reservation/reservation.js +161 -0
- package/lib/module/features/chat/components/reservation/reservation.js.map +1 -0
- package/lib/module/features/chat/components/reservation/reservation.model.js +9 -0
- package/lib/module/features/chat/components/reservation/reservation.model.js.map +1 -0
- package/lib/module/features/chat/components/reservation/reservation.native.js +176 -0
- package/lib/module/features/chat/components/reservation/reservation.native.js.map +1 -0
- package/lib/module/features/chat/model/chat.model.js +16 -0
- package/lib/module/features/chat/model/chat.model.js.map +1 -1
- package/lib/module/features/chat/renderer/renderer.js +26 -0
- package/lib/module/features/chat/renderer/renderer.js.map +1 -1
- package/lib/module/features/chat/renderer/renderer.native.js +26 -0
- package/lib/module/features/chat/renderer/renderer.native.js.map +1 -1
- package/lib/module/native.js +7 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/utils/flight.utils.js +82 -0
- package/lib/module/utils/flight.utils.js.map +1 -0
- package/lib/module/utils/order.utils.js +20 -0
- package/lib/module/utils/order.utils.js.map +1 -0
- package/lib/module/utils/reservation.utils.js +18 -0
- package/lib/module/utils/reservation.utils.js.map +1 -0
- package/lib/module/utils/status-badge.utils.js +70 -0
- package/lib/module/utils/status-badge.utils.js.map +1 -0
- package/lib/module/utils/theme.utils.js +8 -2
- package/lib/module/utils/theme.utils.js.map +1 -1
- package/lib/module/web.js +7 -1
- package/lib/module/web.js.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.native.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/cart-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/cart-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.native.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.native.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.d.ts +12 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.native.d.ts +12 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.model.d.ts +19 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/index.d.ts +3 -0
- package/lib/typescript/commonjs/features/chat/components/flight/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.model.d.ts +22 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/index.d.ts +3 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/info/info.d.ts +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.model.d.ts +3 -0
- package/lib/typescript/commonjs/features/chat/components/info/info.model.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.native.d.ts +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/order/index.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/order/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.model.d.ts +30 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/index.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.model.d.ts +28 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/model/chat.model.d.ts +17 -2
- package/lib/typescript/commonjs/features/chat/model/chat.model.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.d.ts +5 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.native.d.ts +5 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +11 -1
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/flight.utils.d.ts +10 -0
- package/lib/typescript/commonjs/utils/flight.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/order.utils.d.ts +7 -0
- package/lib/typescript/commonjs/utils/order.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/reservation.utils.d.ts +7 -0
- package/lib/typescript/commonjs/utils/reservation.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/status-badge.utils.d.ts +15 -0
- package/lib/typescript/commonjs/utils/status-badge.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/theme.utils.d.ts +3 -0
- package/lib/typescript/commonjs/utils/theme.utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/web.d.ts +11 -1
- package/lib/typescript/commonjs/web.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/common/calendar-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/calendar-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/calendar-icon.native.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/calendar-icon.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/cart-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/cart-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.native.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.native.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.d.ts +12 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.native.d.ts +12 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight/flight.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight.model.d.ts +19 -0
- package/lib/typescript/module/features/chat/components/flight/flight.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight/flight.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/index.d.ts +3 -0
- package/lib/typescript/module/features/chat/components/flight/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.model.d.ts +22 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/index.d.ts +3 -0
- package/lib/typescript/module/features/chat/components/flight-board/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/info/info.d.ts +1 -1
- package/lib/typescript/module/features/chat/components/info/info.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/info/info.model.d.ts +3 -0
- package/lib/typescript/module/features/chat/components/info/info.model.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/info/info.native.d.ts +1 -1
- package/lib/typescript/module/features/chat/components/info/info.native.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/order/index.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/order/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/order/order.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/order/order.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/order/order.model.d.ts +30 -0
- package/lib/typescript/module/features/chat/components/order/order.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/order/order.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/order/order.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/index.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/reservation/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.model.d.ts +28 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/model/chat.model.d.ts +17 -2
- package/lib/typescript/module/features/chat/model/chat.model.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/renderer/renderer.d.ts +5 -1
- package/lib/typescript/module/features/chat/renderer/renderer.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/renderer/renderer.native.d.ts +5 -1
- package/lib/typescript/module/features/chat/renderer/renderer.native.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +11 -1
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/utils/flight.utils.d.ts +10 -0
- package/lib/typescript/module/utils/flight.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/order.utils.d.ts +7 -0
- package/lib/typescript/module/utils/order.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/reservation.utils.d.ts +7 -0
- package/lib/typescript/module/utils/reservation.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/status-badge.utils.d.ts +15 -0
- package/lib/typescript/module/utils/status-badge.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/theme.utils.d.ts +3 -0
- package/lib/typescript/module/utils/theme.utils.d.ts.map +1 -1
- package/lib/typescript/module/web.d.ts +11 -1
- package/lib/typescript/module/web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/chat/components/common/calendar-icon.native.tsx +13 -0
- package/src/features/chat/components/common/calendar-icon.tsx +13 -0
- package/src/features/chat/components/common/cart-icon.tsx +20 -0
- package/src/features/chat/components/common/chevron-icon.native.tsx +18 -0
- package/src/features/chat/components/common/chevron-icon.tsx +18 -0
- package/src/features/chat/components/common/plane-icon.native.tsx +15 -0
- package/src/features/chat/components/common/plane-icon.tsx +15 -0
- package/src/features/chat/components/flight/flight-card.native.tsx +100 -0
- package/src/features/chat/components/flight/flight-card.tsx +100 -0
- package/src/features/chat/components/flight/flight.model.ts +20 -0
- package/src/features/chat/components/flight/flight.native.tsx +131 -0
- package/src/features/chat/components/flight/flight.tsx +131 -0
- package/src/features/chat/components/flight/index.ts +2 -0
- package/src/features/chat/components/flight-board/flight-board.model.ts +23 -0
- package/src/features/chat/components/flight-board/flight-board.native.tsx +155 -0
- package/src/features/chat/components/flight-board/flight-board.tsx +160 -0
- package/src/features/chat/components/flight-board/index.ts +2 -0
- package/src/features/chat/components/info/info.model.ts +3 -0
- package/src/features/chat/components/info/info.native.tsx +47 -11
- package/src/features/chat/components/info/info.tsx +43 -10
- package/src/features/chat/components/order/index.ts +3 -0
- package/src/features/chat/components/order/order.model.ts +32 -0
- package/src/features/chat/components/order/order.native.tsx +172 -0
- package/src/features/chat/components/order/order.tsx +173 -0
- package/src/features/chat/components/reservation/index.ts +3 -0
- package/src/features/chat/components/reservation/reservation.model.ts +30 -0
- package/src/features/chat/components/reservation/reservation.native.tsx +160 -0
- package/src/features/chat/components/reservation/reservation.tsx +162 -0
- package/src/features/chat/model/chat.model.ts +16 -0
- package/src/features/chat/renderer/renderer.native.tsx +29 -1
- package/src/features/chat/renderer/renderer.tsx +29 -1
- package/src/native.ts +11 -1
- package/src/utils/flight.utils.ts +35 -0
- package/src/utils/order.utils.ts +28 -0
- package/src/utils/reservation.utils.ts +23 -0
- package/src/utils/status-badge.utils.ts +36 -0
- package/src/utils/theme.utils.ts +9 -0
- package/src/web.ts +11 -1
|
@@ -1,24 +1,60 @@
|
|
|
1
|
-
import { Text, View } from 'react-native';
|
|
1
|
+
import { Image, Pressable, Text, View } from 'react-native';
|
|
2
2
|
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
3
3
|
import { resolveText } from '../../../../utils/i18n.utils';
|
|
4
|
+
import { ChevronIcon } from '../common/chevron-icon.native';
|
|
4
5
|
import { Theme } from '../../model/chat.model';
|
|
5
6
|
import type { ChatComponentProps } from '../../model/chat.model';
|
|
6
7
|
import type { InfoItem } from './info.model';
|
|
7
8
|
|
|
8
|
-
export function Info({ data, theme = Theme.Dark, language }: ChatComponentProps<InfoItem>) {
|
|
9
|
+
export function Info({ data, theme = Theme.Dark, language, onSelect }: ChatComponentProps<InfoItem>) {
|
|
9
10
|
const c = getThemeClasses(theme);
|
|
10
|
-
const
|
|
11
|
-
if (!item) return null;
|
|
11
|
+
const items = Array.isArray(data) ? data : [data];
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const renderCard = (item: InfoItem, index: number) => {
|
|
14
|
+
const name = resolveText(item.name, language);
|
|
15
|
+
const description = resolveText(item.description, language);
|
|
16
|
+
const kicker = item.kicker ? resolveText(item.kicker, language) : undefined;
|
|
17
|
+
const actionLabel = item.actionLabel ? resolveText(item.actionLabel, language) : undefined;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<View key={index} className={`overflow-hidden rounded-2xl border ${c.surface} ${c.border}`}>
|
|
21
|
+
{item.image ? (
|
|
22
|
+
<Image
|
|
23
|
+
accessibilityLabel={name}
|
|
24
|
+
source={{ uri: item.image }}
|
|
25
|
+
className="h-32 w-full down-sm:h-24"
|
|
26
|
+
/>
|
|
27
|
+
) : null}
|
|
28
|
+
|
|
29
|
+
<View className="flex flex-col gap-2 p-4">
|
|
30
|
+
{kicker ? (
|
|
31
|
+
<Text
|
|
32
|
+
className={`w-fit rounded-full border px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide ${c.actionBorder} ${c.iconText}`}
|
|
33
|
+
>
|
|
34
|
+
{kicker}
|
|
35
|
+
</Text>
|
|
36
|
+
) : null}
|
|
37
|
+
|
|
38
|
+
<Text className={`text-base font-bold down-sm:text-sm ${c.title}`}>{name}</Text>
|
|
39
|
+
<Text className={`text-sm leading-relaxed down-sm:text-xs ${c.subtitle}`}>{description}</Text>
|
|
40
|
+
|
|
41
|
+
{actionLabel ? (
|
|
42
|
+
<Pressable
|
|
43
|
+
onPress={() => onSelect?.(item)}
|
|
44
|
+
className="mt-1 flex-row items-center gap-1"
|
|
45
|
+
>
|
|
46
|
+
<Text className={`text-sm font-semibold ${c.iconText}`}>{actionLabel}</Text>
|
|
47
|
+
<ChevronIcon size={14} color={c.iconColor} />
|
|
48
|
+
</Pressable>
|
|
49
|
+
) : null}
|
|
50
|
+
</View>
|
|
51
|
+
</View>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
15
54
|
|
|
16
55
|
return (
|
|
17
|
-
<View className=
|
|
18
|
-
|
|
19
|
-
<Text className={`mt-1 text-sm leading-relaxed down-sm:text-xs ${c.subtitle}`}>
|
|
20
|
-
{description}
|
|
21
|
-
</Text>
|
|
56
|
+
<View className="flex flex-col gap-3">
|
|
57
|
+
{items.map((item, index) => renderCard(item, index))}
|
|
22
58
|
</View>
|
|
23
59
|
);
|
|
24
60
|
}
|
|
@@ -1,23 +1,56 @@
|
|
|
1
1
|
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
2
2
|
import { resolveText } from '../../../../utils/i18n.utils';
|
|
3
|
+
import { ChevronIcon } from '../common/chevron-icon';
|
|
3
4
|
import { Theme } from '../../model/chat.model';
|
|
4
5
|
import type { ChatComponentProps } from '../../model/chat.model';
|
|
5
6
|
import type { InfoItem } from './info.model';
|
|
6
7
|
|
|
7
|
-
export function Info({ data, theme = Theme.Dark, language }: ChatComponentProps<InfoItem>) {
|
|
8
|
+
export function Info({ data, theme = Theme.Dark, language, onSelect }: ChatComponentProps<InfoItem>) {
|
|
8
9
|
const c = getThemeClasses(theme);
|
|
9
|
-
const
|
|
10
|
-
if (!item) return null;
|
|
10
|
+
const items = Array.isArray(data) ? data : [data];
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const renderCard = (item: InfoItem, index: number) => {
|
|
13
|
+
const name = resolveText(item.name, language);
|
|
14
|
+
const description = resolveText(item.description, language);
|
|
15
|
+
const kicker = item.kicker ? resolveText(item.kicker, language) : undefined;
|
|
16
|
+
const actionLabel = item.actionLabel ? resolveText(item.actionLabel, language) : undefined;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div key={index} className={`overflow-hidden rounded-2xl border ${c.surface} ${c.border}`}>
|
|
20
|
+
{item.image ? (
|
|
21
|
+
<img src={item.image} alt={name} className="h-32 w-full object-cover down-sm:h-24" />
|
|
22
|
+
) : null}
|
|
23
|
+
|
|
24
|
+
<div className="flex flex-col gap-2 p-4">
|
|
25
|
+
{kicker ? (
|
|
26
|
+
<span
|
|
27
|
+
className={`w-fit rounded-full border px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide ${c.actionBorder} ${c.iconText}`}
|
|
28
|
+
>
|
|
29
|
+
{kicker}
|
|
30
|
+
</span>
|
|
31
|
+
) : null}
|
|
32
|
+
|
|
33
|
+
<span className={`text-base font-bold down-sm:text-sm ${c.title}`}>{name}</span>
|
|
34
|
+
<span className={`text-sm leading-relaxed down-sm:text-xs ${c.subtitle}`}>{description}</span>
|
|
35
|
+
|
|
36
|
+
{actionLabel ? (
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
onClick={() => onSelect?.(item)}
|
|
40
|
+
className={`mt-1 flex w-fit items-center gap-1 text-sm font-semibold ${c.iconText}`}
|
|
41
|
+
>
|
|
42
|
+
{actionLabel}
|
|
43
|
+
<ChevronIcon size={14} color="currentColor" />
|
|
44
|
+
</button>
|
|
45
|
+
) : null}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
14
50
|
|
|
15
51
|
return (
|
|
16
|
-
<div className=
|
|
17
|
-
|
|
18
|
-
<span className={`mt-1 block text-sm leading-relaxed down-sm:text-xs ${c.subtitle}`}>
|
|
19
|
-
{description}
|
|
20
|
-
</span>
|
|
52
|
+
<div className="flex flex-col gap-3">
|
|
53
|
+
{items.map((item, index) => renderCard(item, index))}
|
|
21
54
|
</div>
|
|
22
55
|
);
|
|
23
56
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { LocalizedText } from '../../model/chat.model';
|
|
2
|
+
|
|
3
|
+
export enum OrderStatus {
|
|
4
|
+
Pending = 'pending',
|
|
5
|
+
Preparing = 'preparing',
|
|
6
|
+
Accepted = 'accepted',
|
|
7
|
+
Rejected = 'rejected',
|
|
8
|
+
Delivered = 'delivered',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface OrderRow {
|
|
12
|
+
id: number;
|
|
13
|
+
image?: string;
|
|
14
|
+
name: LocalizedText;
|
|
15
|
+
quantity: number;
|
|
16
|
+
unitPrice?: string;
|
|
17
|
+
duration?: string;
|
|
18
|
+
price: string;
|
|
19
|
+
status?: OrderStatus;
|
|
20
|
+
statusLabel?: LocalizedText;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface OrderListItem {
|
|
24
|
+
orderNumber: string;
|
|
25
|
+
location?: LocalizedText;
|
|
26
|
+
status?: OrderStatus;
|
|
27
|
+
statusLabel?: LocalizedText;
|
|
28
|
+
items: OrderRow[];
|
|
29
|
+
totalLabel?: LocalizedText;
|
|
30
|
+
total?: string;
|
|
31
|
+
actionLabel?: LocalizedText;
|
|
32
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Image, Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
4
|
+
import { getOrderStatusStyle } from '../../../../utils/order.utils';
|
|
5
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
6
|
+
import { useExpandableList } from '../../../../utils/use-expandable-list';
|
|
7
|
+
import { Collapsible } from '../common/collapsible.native';
|
|
8
|
+
import { CartIcon } from '../common/cart-icon.native';
|
|
9
|
+
import { ChevronIcon } from '../common/chevron-icon.native';
|
|
10
|
+
import { OrderStatus } from './order.model';
|
|
11
|
+
import { ItemAction, Theme } from '../../model/chat.model';
|
|
12
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
13
|
+
import type { OrderListItem, OrderRow } from './order.model';
|
|
14
|
+
|
|
15
|
+
export function Order({
|
|
16
|
+
data,
|
|
17
|
+
theme = Theme.Dark,
|
|
18
|
+
language,
|
|
19
|
+
actionLabel,
|
|
20
|
+
onAction,
|
|
21
|
+
onSelect,
|
|
22
|
+
}: ChatComponentProps<OrderListItem>) {
|
|
23
|
+
const c = getThemeClasses(theme);
|
|
24
|
+
const order = Array.isArray(data) ? data[0] : data;
|
|
25
|
+
const items = order?.items ?? [];
|
|
26
|
+
const { head, rest, expanded, hasMore, toggle } = useExpandableList(items);
|
|
27
|
+
|
|
28
|
+
if (!order) return null;
|
|
29
|
+
|
|
30
|
+
const onSelectRow = onSelect as ((row: OrderRow) => void) | undefined;
|
|
31
|
+
const location = order.location ? resolveText(order.location, language) : undefined;
|
|
32
|
+
const totalLabel = order.totalLabel ? resolveText(order.totalLabel, language) : undefined;
|
|
33
|
+
const action = order.actionLabel
|
|
34
|
+
? resolveText(order.actionLabel, language)
|
|
35
|
+
: typeof actionLabel === 'function'
|
|
36
|
+
? actionLabel(order)
|
|
37
|
+
: actionLabel;
|
|
38
|
+
const headerStyle = getOrderStatusStyle(order.status, theme);
|
|
39
|
+
const headerStatusLabel = order.statusLabel ? resolveText(order.statusLabel, language) : headerStyle.label;
|
|
40
|
+
|
|
41
|
+
const renderRow = (row: OrderRow) => {
|
|
42
|
+
const name = resolveText(row.name, language);
|
|
43
|
+
const isRejected = row.status === OrderStatus.Rejected;
|
|
44
|
+
const s = getOrderStatusStyle(row.status, theme);
|
|
45
|
+
const statusLabel = row.statusLabel ? resolveText(row.statusLabel, language) : s.label;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Pressable className="flex-row items-center gap-3 py-2.5" onPress={() => onSelectRow?.(row)}>
|
|
49
|
+
<View className="relative">
|
|
50
|
+
{row.image ? (
|
|
51
|
+
<Image accessibilityLabel={name} source={{ uri: row.image }} className={`h-11 w-11 rounded-lg ${c.iconBg}`} />
|
|
52
|
+
) : (
|
|
53
|
+
<View className={`h-11 w-11 rounded-lg ${c.iconBg}`} />
|
|
54
|
+
)}
|
|
55
|
+
{row.quantity > 1 ? (
|
|
56
|
+
<View className="absolute -right-1.5 -top-1.5 h-5 w-5 items-center justify-center rounded-full bg-indigo-500">
|
|
57
|
+
<Text className="text-[10px] font-bold text-white">{row.quantity}</Text>
|
|
58
|
+
</View>
|
|
59
|
+
) : null}
|
|
60
|
+
</View>
|
|
61
|
+
|
|
62
|
+
<View className="flex-1 gap-1">
|
|
63
|
+
<View className="flex-row items-center justify-between gap-2">
|
|
64
|
+
<Text
|
|
65
|
+
className={`flex-1 text-sm font-semibold ${isRejected ? 'line-through opacity-60' : ''} ${c.title}`}
|
|
66
|
+
numberOfLines={1}
|
|
67
|
+
>
|
|
68
|
+
{name}
|
|
69
|
+
</Text>
|
|
70
|
+
<Text className={`text-sm font-bold ${isRejected ? 'line-through opacity-60' : ''} ${c.price}`}>
|
|
71
|
+
{row.price}
|
|
72
|
+
</Text>
|
|
73
|
+
</View>
|
|
74
|
+
<View className="flex-row items-center justify-between gap-2">
|
|
75
|
+
<Text className={`flex-1 text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
76
|
+
{row.unitPrice ? `${row.unitPrice} each` : ''}
|
|
77
|
+
{row.unitPrice && row.duration ? ' · ' : ''}
|
|
78
|
+
{row.duration ?? ''}
|
|
79
|
+
</Text>
|
|
80
|
+
{row.status ? (
|
|
81
|
+
<View className={`rounded-full px-2 py-0.5 ${s.badgeBg}`}>
|
|
82
|
+
<Text className={`text-[11px] font-semibold ${s.badgeText}`}>{statusLabel}</Text>
|
|
83
|
+
</View>
|
|
84
|
+
) : null}
|
|
85
|
+
</View>
|
|
86
|
+
</View>
|
|
87
|
+
</Pressable>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<View className={`rounded-2xl border p-3.5 ${c.surface} ${c.border}`}>
|
|
93
|
+
<View className="flex-row items-center gap-3">
|
|
94
|
+
<View className={`h-11 w-11 items-center justify-center rounded-xl ${c.iconBg}`}>
|
|
95
|
+
<CartIcon size={20} color={c.iconColor} />
|
|
96
|
+
</View>
|
|
97
|
+
|
|
98
|
+
<View className="flex-1">
|
|
99
|
+
<Text className={`text-base font-bold ${c.title}`} numberOfLines={1}>
|
|
100
|
+
Order #{order.orderNumber}
|
|
101
|
+
</Text>
|
|
102
|
+
{location ? (
|
|
103
|
+
<Text className={`text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
104
|
+
{location}
|
|
105
|
+
</Text>
|
|
106
|
+
) : null}
|
|
107
|
+
</View>
|
|
108
|
+
|
|
109
|
+
<View className={`rounded-full px-2.5 py-1 ${headerStyle.badgeBg}`}>
|
|
110
|
+
<Text className={`text-xs font-semibold ${headerStyle.badgeText}`}>{headerStatusLabel}</Text>
|
|
111
|
+
</View>
|
|
112
|
+
</View>
|
|
113
|
+
|
|
114
|
+
<View className={`my-3 h-px ${c.divider}`} />
|
|
115
|
+
|
|
116
|
+
{head.map((row, index) => (
|
|
117
|
+
<Fragment key={row.id}>
|
|
118
|
+
{index > 0 ? <View className={`h-px ${c.divider}`} /> : null}
|
|
119
|
+
{renderRow(row)}
|
|
120
|
+
</Fragment>
|
|
121
|
+
))}
|
|
122
|
+
|
|
123
|
+
{hasMore ? (
|
|
124
|
+
<Collapsible expanded={expanded}>
|
|
125
|
+
{rest.map((row) => (
|
|
126
|
+
<Fragment key={row.id}>
|
|
127
|
+
<View className={`h-px ${c.divider}`} />
|
|
128
|
+
{renderRow(row)}
|
|
129
|
+
</Fragment>
|
|
130
|
+
))}
|
|
131
|
+
</Collapsible>
|
|
132
|
+
) : null}
|
|
133
|
+
|
|
134
|
+
{hasMore ? (
|
|
135
|
+
<Pressable onPress={toggle} className="mt-1 flex-row items-center justify-between gap-2 py-2">
|
|
136
|
+
<View className="flex-row items-center gap-2">
|
|
137
|
+
<Text className={`text-sm ${c.subtitle}`}>
|
|
138
|
+
{expanded ? `Showing all ${items.length} items` : `Showing ${head.length} of ${items.length} items`}
|
|
139
|
+
</Text>
|
|
140
|
+
</View>
|
|
141
|
+
<View className="flex-row items-center gap-1">
|
|
142
|
+
<Text className={`text-sm font-semibold ${c.iconText}`}>{expanded ? 'Show less' : 'View all'}</Text>
|
|
143
|
+
<View className={expanded ? 'rotate-180' : undefined}>
|
|
144
|
+
<ChevronIcon size={14} color={c.iconColor} />
|
|
145
|
+
</View>
|
|
146
|
+
</View>
|
|
147
|
+
</Pressable>
|
|
148
|
+
) : null}
|
|
149
|
+
|
|
150
|
+
{order.total || action ? (
|
|
151
|
+
<>
|
|
152
|
+
<View className={`my-3 h-px ${c.divider}`} />
|
|
153
|
+
<View className="flex-row items-center justify-between gap-3">
|
|
154
|
+
<View>
|
|
155
|
+
{totalLabel ? <Text className={`text-xs ${c.subtitle}`}>{totalLabel}</Text> : null}
|
|
156
|
+
{order.total ? <Text className={`text-lg font-bold ${c.title}`}>{order.total}</Text> : null}
|
|
157
|
+
</View>
|
|
158
|
+
|
|
159
|
+
{action ? (
|
|
160
|
+
<Pressable
|
|
161
|
+
onPress={() => onAction?.(order, ItemAction.Track)}
|
|
162
|
+
className="rounded-xl bg-indigo-500 px-4 py-2"
|
|
163
|
+
>
|
|
164
|
+
<Text className="text-sm font-semibold text-white">{action}</Text>
|
|
165
|
+
</Pressable>
|
|
166
|
+
) : null}
|
|
167
|
+
</View>
|
|
168
|
+
</>
|
|
169
|
+
) : null}
|
|
170
|
+
</View>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
3
|
+
import { getOrderStatusStyle } from '../../../../utils/order.utils';
|
|
4
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
5
|
+
import { useExpandableList } from '../../../../utils/use-expandable-list';
|
|
6
|
+
import { Collapsible } from '../common/collapsible';
|
|
7
|
+
import { CartIcon } from '../common/cart-icon';
|
|
8
|
+
import { ChevronIcon } from '../common/chevron-icon';
|
|
9
|
+
import { OrderStatus } from './order.model';
|
|
10
|
+
import { ItemAction, Theme } from '../../model/chat.model';
|
|
11
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
12
|
+
import type { OrderListItem, OrderRow } from './order.model';
|
|
13
|
+
|
|
14
|
+
export function Order({
|
|
15
|
+
data,
|
|
16
|
+
theme = Theme.Dark,
|
|
17
|
+
language,
|
|
18
|
+
actionLabel,
|
|
19
|
+
onAction,
|
|
20
|
+
onSelect,
|
|
21
|
+
}: ChatComponentProps<OrderListItem>) {
|
|
22
|
+
const c = getThemeClasses(theme);
|
|
23
|
+
const order = Array.isArray(data) ? data[0] : data;
|
|
24
|
+
const items = order?.items ?? [];
|
|
25
|
+
const { head, rest, expanded, hasMore, toggle } = useExpandableList(items);
|
|
26
|
+
|
|
27
|
+
if (!order) return null;
|
|
28
|
+
|
|
29
|
+
const onSelectRow = onSelect as ((row: OrderRow) => void) | undefined;
|
|
30
|
+
const location = order.location ? resolveText(order.location, language) : undefined;
|
|
31
|
+
const totalLabel = order.totalLabel ? resolveText(order.totalLabel, language) : undefined;
|
|
32
|
+
const action = order.actionLabel
|
|
33
|
+
? resolveText(order.actionLabel, language)
|
|
34
|
+
: typeof actionLabel === 'function'
|
|
35
|
+
? actionLabel(order)
|
|
36
|
+
: actionLabel;
|
|
37
|
+
const headerStyle = getOrderStatusStyle(order.status, theme);
|
|
38
|
+
const headerStatusLabel = order.statusLabel ? resolveText(order.statusLabel, language) : headerStyle.label;
|
|
39
|
+
|
|
40
|
+
const renderRow = (row: OrderRow) => {
|
|
41
|
+
const name = resolveText(row.name, language);
|
|
42
|
+
const isRejected = row.status === OrderStatus.Rejected;
|
|
43
|
+
const s = getOrderStatusStyle(row.status, theme);
|
|
44
|
+
const statusLabel = row.statusLabel ? resolveText(row.statusLabel, language) : s.label;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
className="flex w-full items-center gap-3 py-2.5 text-left"
|
|
50
|
+
onClick={() => onSelectRow?.(row)}
|
|
51
|
+
>
|
|
52
|
+
<div className="relative shrink-0">
|
|
53
|
+
{row.image ? (
|
|
54
|
+
<img src={row.image} alt={name} className={`h-11 w-11 rounded-lg object-cover ${c.iconBg}`} />
|
|
55
|
+
) : (
|
|
56
|
+
<div className={`h-11 w-11 rounded-lg ${c.iconBg}`} />
|
|
57
|
+
)}
|
|
58
|
+
{row.quantity > 1 ? (
|
|
59
|
+
<span className="absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-indigo-500 text-[10px] font-bold text-white">
|
|
60
|
+
{row.quantity}
|
|
61
|
+
</span>
|
|
62
|
+
) : null}
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
|
66
|
+
<div className="flex items-center justify-between gap-2">
|
|
67
|
+
<span className={`truncate text-sm font-semibold ${isRejected ? 'line-through opacity-60' : ''} ${c.title}`}>
|
|
68
|
+
{name}
|
|
69
|
+
</span>
|
|
70
|
+
<span className={`shrink-0 text-sm font-bold ${isRejected ? 'line-through opacity-60' : ''} ${c.price}`}>
|
|
71
|
+
{row.price}
|
|
72
|
+
</span>
|
|
73
|
+
</div>
|
|
74
|
+
<div className="flex items-center justify-between gap-2">
|
|
75
|
+
<span className={`truncate text-xs ${c.subtitle}`}>
|
|
76
|
+
{row.unitPrice ? `${row.unitPrice} each` : ''}
|
|
77
|
+
{row.unitPrice && row.duration ? ' · ' : ''}
|
|
78
|
+
{row.duration ?? ''}
|
|
79
|
+
</span>
|
|
80
|
+
{row.status ? (
|
|
81
|
+
<span className={`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold ${s.badgeBg} ${s.badgeText}`}>
|
|
82
|
+
{statusLabel}
|
|
83
|
+
</span>
|
|
84
|
+
) : null}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</button>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div className={`rounded-2xl border p-3.5 ${c.surface} ${c.border}`}>
|
|
93
|
+
<div className="flex items-center gap-3">
|
|
94
|
+
<div className={`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${c.iconBg}`}>
|
|
95
|
+
<CartIcon size={20} color={c.iconColor} />
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
99
|
+
<span className={`truncate text-base font-bold ${c.title}`}>Order #{order.orderNumber}</span>
|
|
100
|
+
{location ? <span className={`truncate text-xs ${c.subtitle}`}>{location}</span> : null}
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<span
|
|
104
|
+
className={`shrink-0 rounded-full px-2.5 py-1 text-xs font-semibold ${headerStyle.badgeBg} ${headerStyle.badgeText}`}
|
|
105
|
+
>
|
|
106
|
+
{headerStatusLabel}
|
|
107
|
+
</span>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div className={`my-3 h-px ${c.divider}`} />
|
|
111
|
+
|
|
112
|
+
{head.map((row, index) => (
|
|
113
|
+
<Fragment key={row.id}>
|
|
114
|
+
{index > 0 ? <div className={`h-px ${c.divider}`} /> : null}
|
|
115
|
+
{renderRow(row)}
|
|
116
|
+
</Fragment>
|
|
117
|
+
))}
|
|
118
|
+
|
|
119
|
+
{hasMore ? (
|
|
120
|
+
<Collapsible expanded={expanded}>
|
|
121
|
+
{rest.map((row) => (
|
|
122
|
+
<Fragment key={row.id}>
|
|
123
|
+
<div className={`h-px ${c.divider}`} />
|
|
124
|
+
{renderRow(row)}
|
|
125
|
+
</Fragment>
|
|
126
|
+
))}
|
|
127
|
+
</Collapsible>
|
|
128
|
+
) : null}
|
|
129
|
+
|
|
130
|
+
{hasMore ? (
|
|
131
|
+
<button
|
|
132
|
+
type="button"
|
|
133
|
+
onClick={toggle}
|
|
134
|
+
className="mt-1 flex w-full items-center justify-between gap-2 rounded-xl py-2"
|
|
135
|
+
>
|
|
136
|
+
<div className="flex items-center gap-2">
|
|
137
|
+
<span className={`text-sm ${c.subtitle}`}>
|
|
138
|
+
{expanded ? `Showing all ${items.length} items` : `Showing ${head.length} of ${items.length} items`}
|
|
139
|
+
</span>
|
|
140
|
+
</div>
|
|
141
|
+
<span className={`flex shrink-0 items-center gap-1 text-sm font-semibold ${c.iconText}`}>
|
|
142
|
+
{expanded ? 'Show less' : 'View all'}
|
|
143
|
+
<span className={`transition-transform ${expanded ? 'rotate-180' : ''}`}>
|
|
144
|
+
<ChevronIcon size={14} color="currentColor" />
|
|
145
|
+
</span>
|
|
146
|
+
</span>
|
|
147
|
+
</button>
|
|
148
|
+
) : null}
|
|
149
|
+
|
|
150
|
+
{order.total || action ? (
|
|
151
|
+
<>
|
|
152
|
+
<div className={`my-3 h-px ${c.divider}`} />
|
|
153
|
+
<div className="flex items-center justify-between gap-3">
|
|
154
|
+
<div className="flex flex-col">
|
|
155
|
+
{totalLabel ? <span className={`text-xs ${c.subtitle}`}>{totalLabel}</span> : null}
|
|
156
|
+
{order.total ? <span className={`text-lg font-bold ${c.title}`}>{order.total}</span> : null}
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
{action ? (
|
|
160
|
+
<button
|
|
161
|
+
type="button"
|
|
162
|
+
onClick={() => onAction?.(order, ItemAction.Track)}
|
|
163
|
+
className="rounded-xl bg-indigo-500 px-4 py-2 text-sm font-semibold text-white"
|
|
164
|
+
>
|
|
165
|
+
{action}
|
|
166
|
+
</button>
|
|
167
|
+
) : null}
|
|
168
|
+
</div>
|
|
169
|
+
</>
|
|
170
|
+
) : null}
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { LocalizedText } from '../../model/chat.model';
|
|
2
|
+
|
|
3
|
+
export enum ReservationStatus {
|
|
4
|
+
Pending = 'pending',
|
|
5
|
+
Confirmed = 'confirmed',
|
|
6
|
+
Cancelled = 'cancelled',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ReservationRow {
|
|
10
|
+
id: number;
|
|
11
|
+
image?: string;
|
|
12
|
+
name: LocalizedText;
|
|
13
|
+
date: string;
|
|
14
|
+
time: string;
|
|
15
|
+
duration?: string;
|
|
16
|
+
price: string;
|
|
17
|
+
status: ReservationStatus;
|
|
18
|
+
statusLabel?: LocalizedText;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ReservationListItem {
|
|
22
|
+
title: LocalizedText;
|
|
23
|
+
subtitle?: LocalizedText;
|
|
24
|
+
status?: ReservationStatus;
|
|
25
|
+
statusLabel?: LocalizedText;
|
|
26
|
+
reservations: ReservationRow[];
|
|
27
|
+
totalLabel?: LocalizedText;
|
|
28
|
+
total?: string;
|
|
29
|
+
actionLabel?: LocalizedText;
|
|
30
|
+
}
|