@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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FlightStatus, LocalizedText } from '../../model/chat.model';
|
|
2
|
+
|
|
3
|
+
export interface Airport {
|
|
4
|
+
code: string;
|
|
5
|
+
city: LocalizedText;
|
|
6
|
+
time: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FlightItem {
|
|
10
|
+
id: number;
|
|
11
|
+
airline: LocalizedText;
|
|
12
|
+
flightNumber: string;
|
|
13
|
+
status?: FlightStatus;
|
|
14
|
+
statusLabel?: LocalizedText;
|
|
15
|
+
date?: LocalizedText;
|
|
16
|
+
terminal?: LocalizedText;
|
|
17
|
+
from: Airport;
|
|
18
|
+
to: Airport;
|
|
19
|
+
duration?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
4
|
+
import { getFlightStatusStyle } from '../../../../utils/flight.utils';
|
|
5
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
6
|
+
import { Collapsible } from '../common/collapsible.native';
|
|
7
|
+
import { PlaneIcon } from '../common/plane-icon.native';
|
|
8
|
+
import { ChevronIcon } from '../common/chevron-icon.native';
|
|
9
|
+
import { FlightStatus, Theme } from '../../model/chat.model';
|
|
10
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
11
|
+
import type { FlightItem } from './flight.model';
|
|
12
|
+
|
|
13
|
+
function FlightCard({
|
|
14
|
+
item,
|
|
15
|
+
theme,
|
|
16
|
+
language,
|
|
17
|
+
accent,
|
|
18
|
+
defaultExpanded,
|
|
19
|
+
onSelect,
|
|
20
|
+
}: {
|
|
21
|
+
item: FlightItem;
|
|
22
|
+
theme: Theme;
|
|
23
|
+
language?: string;
|
|
24
|
+
accent: boolean;
|
|
25
|
+
defaultExpanded: boolean;
|
|
26
|
+
onSelect?: (item: FlightItem) => void;
|
|
27
|
+
}) {
|
|
28
|
+
const c = getThemeClasses(theme);
|
|
29
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
30
|
+
|
|
31
|
+
const s = getFlightStatusStyle(item.status ?? FlightStatus.OnTime, theme);
|
|
32
|
+
const statusLabel = item.statusLabel ? resolveText(item.statusLabel, language) : s.label;
|
|
33
|
+
const airline = resolveText(item.airline, language);
|
|
34
|
+
const fromCity = resolveText(item.from.city, language);
|
|
35
|
+
const toCity = resolveText(item.to.city, language);
|
|
36
|
+
const subline = item.date
|
|
37
|
+
? `${resolveText(item.date, language)}${item.terminal ? ` · ${resolveText(item.terminal, language)}` : ''}`
|
|
38
|
+
: '';
|
|
39
|
+
const compact = `${item.from.code} → ${item.to.code} · ${item.from.time}`;
|
|
40
|
+
|
|
41
|
+
const iconBg = accent ? c.iconBg : c.mutedIconBg;
|
|
42
|
+
const iconColor = accent ? c.iconColor : c.mutedIconColor;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View className={`rounded-2xl border p-3 ${c.surface} ${c.border}`}>
|
|
46
|
+
<Pressable
|
|
47
|
+
className="flex-row items-center gap-3"
|
|
48
|
+
onPress={() => {
|
|
49
|
+
setExpanded((v) => !v);
|
|
50
|
+
onSelect?.(item);
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<View className={`h-11 w-11 items-center justify-center rounded-xl ${iconBg}`}>
|
|
54
|
+
<PlaneIcon size={20} color={iconColor} />
|
|
55
|
+
</View>
|
|
56
|
+
|
|
57
|
+
<View className="flex-1 gap-0.5">
|
|
58
|
+
<Text className={`text-base font-bold down-sm:text-sm ${c.title}`} numberOfLines={2}>
|
|
59
|
+
{airline} · {item.flightNumber}
|
|
60
|
+
</Text>
|
|
61
|
+
<Text className={`text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
62
|
+
{expanded ? subline || compact : compact}
|
|
63
|
+
</Text>
|
|
64
|
+
</View>
|
|
65
|
+
|
|
66
|
+
<View className={`flex-row items-center gap-1.5 rounded-full px-2.5 py-1 ${s.badgeBg}`}>
|
|
67
|
+
{s.showDot ? <View className={`h-1.5 w-1.5 rounded-full ${s.dot}`} /> : null}
|
|
68
|
+
<Text className={`text-xs font-semibold ${s.badgeText}`}>{statusLabel}</Text>
|
|
69
|
+
</View>
|
|
70
|
+
|
|
71
|
+
<View className={expanded ? 'rotate-180' : undefined}>
|
|
72
|
+
<ChevronIcon size={18} color={c.mutedIconColor} />
|
|
73
|
+
</View>
|
|
74
|
+
</Pressable>
|
|
75
|
+
|
|
76
|
+
<Collapsible expanded={expanded}>
|
|
77
|
+
<View className="mt-4 flex-row items-center">
|
|
78
|
+
<View className="items-start">
|
|
79
|
+
<Text className={`text-3xl font-bold down-sm:text-2xl ${c.title}`}>{item.from.code}</Text>
|
|
80
|
+
<Text className={`text-base font-semibold ${c.title}`}>{item.from.time}</Text>
|
|
81
|
+
<Text className={`text-xs ${c.subtitle}`}>{fromCity}</Text>
|
|
82
|
+
</View>
|
|
83
|
+
|
|
84
|
+
<View className="flex-1 items-center px-3">
|
|
85
|
+
{item.duration ? <Text className={`mb-1 text-xs ${c.subtitle}`}>{item.duration}</Text> : null}
|
|
86
|
+
<View className="w-full flex-row items-center">
|
|
87
|
+
<View className={`h-2 w-2 rounded-full ${s.dot}`} />
|
|
88
|
+
<View className={`flex-1 border-t border-dashed ${c.dashLine}`} />
|
|
89
|
+
<View className="rotate-90">
|
|
90
|
+
<PlaneIcon size={16} color={c.iconColor} />
|
|
91
|
+
</View>
|
|
92
|
+
<View className={`flex-1 border-t border-dashed ${c.dashLine}`} />
|
|
93
|
+
<View className={`h-2 w-2 rounded-full ${s.dot}`} />
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
96
|
+
|
|
97
|
+
<View className="items-end">
|
|
98
|
+
<Text className={`text-3xl font-bold down-sm:text-2xl ${c.title}`}>{item.to.code}</Text>
|
|
99
|
+
<Text className={`text-base font-semibold ${c.title}`}>{item.to.time}</Text>
|
|
100
|
+
<Text className={`text-xs ${c.subtitle}`}>{toCity}</Text>
|
|
101
|
+
</View>
|
|
102
|
+
</View>
|
|
103
|
+
</Collapsible>
|
|
104
|
+
</View>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function Flight({
|
|
109
|
+
data,
|
|
110
|
+
theme = Theme.Dark,
|
|
111
|
+
language,
|
|
112
|
+
onSelect,
|
|
113
|
+
}: ChatComponentProps<FlightItem>) {
|
|
114
|
+
const items = Array.isArray(data) ? data : [data];
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<View className="gap-3">
|
|
118
|
+
{items.map((item, index) => (
|
|
119
|
+
<FlightCard
|
|
120
|
+
key={item.id}
|
|
121
|
+
item={item}
|
|
122
|
+
theme={theme}
|
|
123
|
+
language={language}
|
|
124
|
+
accent={index === 0}
|
|
125
|
+
defaultExpanded={index === 0}
|
|
126
|
+
onSelect={onSelect}
|
|
127
|
+
/>
|
|
128
|
+
))}
|
|
129
|
+
</View>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
3
|
+
import { getFlightStatusStyle } from '../../../../utils/flight.utils';
|
|
4
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
5
|
+
import { Collapsible } from '../common/collapsible';
|
|
6
|
+
import { PlaneIcon } from '../common/plane-icon';
|
|
7
|
+
import { ChevronIcon } from '../common/chevron-icon';
|
|
8
|
+
import { FlightStatus, Theme } from '../../model/chat.model';
|
|
9
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
10
|
+
import type { FlightItem } from './flight.model';
|
|
11
|
+
|
|
12
|
+
function FlightCard({
|
|
13
|
+
item,
|
|
14
|
+
theme,
|
|
15
|
+
language,
|
|
16
|
+
accent,
|
|
17
|
+
defaultExpanded,
|
|
18
|
+
onSelect,
|
|
19
|
+
}: {
|
|
20
|
+
item: FlightItem;
|
|
21
|
+
theme: Theme;
|
|
22
|
+
language?: string;
|
|
23
|
+
accent: boolean;
|
|
24
|
+
defaultExpanded: boolean;
|
|
25
|
+
onSelect?: (item: FlightItem) => void;
|
|
26
|
+
}) {
|
|
27
|
+
const c = getThemeClasses(theme);
|
|
28
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
29
|
+
|
|
30
|
+
const s = getFlightStatusStyle(item.status ?? FlightStatus.OnTime, theme);
|
|
31
|
+
const statusLabel = item.statusLabel ? resolveText(item.statusLabel, language) : s.label;
|
|
32
|
+
const airline = resolveText(item.airline, language);
|
|
33
|
+
const fromCity = resolveText(item.from.city, language);
|
|
34
|
+
const toCity = resolveText(item.to.city, language);
|
|
35
|
+
const subline = item.date
|
|
36
|
+
? `${resolveText(item.date, language)}${item.terminal ? ` · ${resolveText(item.terminal, language)}` : ''}`
|
|
37
|
+
: '';
|
|
38
|
+
const compact = `${item.from.code} → ${item.to.code} · ${item.from.time}`;
|
|
39
|
+
|
|
40
|
+
const iconBg = accent ? c.iconBg : c.mutedIconBg;
|
|
41
|
+
const iconColor = accent ? c.iconColor : c.mutedIconColor;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className={`rounded-2xl border p-3 ${c.surface} ${c.border}`}>
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
className="flex w-full items-center gap-3 text-left"
|
|
48
|
+
onClick={() => {
|
|
49
|
+
setExpanded((v) => !v);
|
|
50
|
+
onSelect?.(item);
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<div className={`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${iconBg}`}>
|
|
54
|
+
<PlaneIcon size={20} color={iconColor} />
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
58
|
+
<span className={`text-base font-bold down-sm:text-sm ${c.title}`}>
|
|
59
|
+
{airline} · {item.flightNumber}
|
|
60
|
+
</span>
|
|
61
|
+
<span className={`truncate text-xs ${c.subtitle}`}>
|
|
62
|
+
{expanded ? subline || compact : compact}
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div className={`flex shrink-0 items-center gap-1.5 rounded-full px-2.5 py-1 ${s.badgeBg}`}>
|
|
67
|
+
{s.showDot ? <span className={`h-1.5 w-1.5 rounded-full ${s.dot}`} /> : null}
|
|
68
|
+
<span className={`text-xs font-semibold ${s.badgeText}`}>{statusLabel}</span>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<span className={`shrink-0 transition-transform ${expanded ? 'rotate-180' : ''}`}>
|
|
72
|
+
<ChevronIcon size={18} color={c.mutedIconColor} />
|
|
73
|
+
</span>
|
|
74
|
+
</button>
|
|
75
|
+
|
|
76
|
+
<Collapsible expanded={expanded}>
|
|
77
|
+
<div className="mt-4 flex items-center">
|
|
78
|
+
<div className="flex flex-col items-start">
|
|
79
|
+
<span className={`text-3xl font-bold down-sm:text-2xl ${c.title}`}>{item.from.code}</span>
|
|
80
|
+
<span className={`text-base font-semibold ${c.title}`}>{item.from.time}</span>
|
|
81
|
+
<span className={`text-xs ${c.subtitle}`}>{fromCity}</span>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div className="flex flex-1 flex-col items-center px-3">
|
|
85
|
+
{item.duration ? <span className={`mb-1 text-xs ${c.subtitle}`}>{item.duration}</span> : null}
|
|
86
|
+
<div className="flex w-full items-center">
|
|
87
|
+
<span className={`h-2 w-2 shrink-0 rounded-full ${s.dot}`} />
|
|
88
|
+
<span className={`flex-1 border-t border-dashed ${c.dashLine}`} />
|
|
89
|
+
<span className="rotate-90">
|
|
90
|
+
<PlaneIcon size={16} color={c.iconColor} />
|
|
91
|
+
</span>
|
|
92
|
+
<span className={`flex-1 border-t border-dashed ${c.dashLine}`} />
|
|
93
|
+
<span className={`h-2 w-2 shrink-0 rounded-full ${s.dot}`} />
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div className="flex flex-col items-end">
|
|
98
|
+
<span className={`text-3xl font-bold down-sm:text-2xl ${c.title}`}>{item.to.code}</span>
|
|
99
|
+
<span className={`text-base font-semibold ${c.title}`}>{item.to.time}</span>
|
|
100
|
+
<span className={`text-xs ${c.subtitle}`}>{toCity}</span>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</Collapsible>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function Flight({
|
|
109
|
+
data,
|
|
110
|
+
theme = Theme.Dark,
|
|
111
|
+
language,
|
|
112
|
+
onSelect,
|
|
113
|
+
}: ChatComponentProps<FlightItem>) {
|
|
114
|
+
const items = Array.isArray(data) ? data : [data];
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div className="flex flex-col gap-3">
|
|
118
|
+
{items.map((item, index) => (
|
|
119
|
+
<FlightCard
|
|
120
|
+
key={item.id}
|
|
121
|
+
item={item}
|
|
122
|
+
theme={theme}
|
|
123
|
+
language={language}
|
|
124
|
+
accent={index === 0}
|
|
125
|
+
defaultExpanded={index === 0}
|
|
126
|
+
onSelect={onSelect}
|
|
127
|
+
/>
|
|
128
|
+
))}
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FlightStatus, LocalizedText } from '../../model/chat.model';
|
|
2
|
+
|
|
3
|
+
export interface FlightRow {
|
|
4
|
+
id: number;
|
|
5
|
+
time: string;
|
|
6
|
+
city: LocalizedText;
|
|
7
|
+
code: string;
|
|
8
|
+
airline: LocalizedText;
|
|
9
|
+
flightNumber: string;
|
|
10
|
+
gate?: string;
|
|
11
|
+
status?: FlightStatus;
|
|
12
|
+
statusLabel?: LocalizedText;
|
|
13
|
+
accent?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface FlightBoardItem {
|
|
17
|
+
airport: LocalizedText;
|
|
18
|
+
code: string;
|
|
19
|
+
updatedAt?: string;
|
|
20
|
+
live?: boolean;
|
|
21
|
+
departures: FlightRow[];
|
|
22
|
+
arrivals?: FlightRow[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Fragment, useState } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
4
|
+
import { getFlightStatusStyle } from '../../../../utils/flight.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 { PlaneIcon } from '../common/plane-icon.native';
|
|
9
|
+
import { ChevronIcon } from '../common/chevron-icon.native';
|
|
10
|
+
import { FlightStatus, Theme } from '../../model/chat.model';
|
|
11
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
12
|
+
import type { FlightBoardItem, FlightRow } from './flight-board.model';
|
|
13
|
+
|
|
14
|
+
const BOARD_COLLAPSED_COUNT = 5;
|
|
15
|
+
type Tab = 'departures' | 'arrivals';
|
|
16
|
+
|
|
17
|
+
export function FlightBoard({
|
|
18
|
+
data,
|
|
19
|
+
theme = Theme.Dark,
|
|
20
|
+
language,
|
|
21
|
+
onSelect,
|
|
22
|
+
}: ChatComponentProps<FlightBoardItem>) {
|
|
23
|
+
const c = getThemeClasses(theme);
|
|
24
|
+
const board = Array.isArray(data) ? data[0] : data;
|
|
25
|
+
const [tab, setTab] = useState<Tab>('departures');
|
|
26
|
+
const onSelectRow = onSelect as ((row: FlightRow) => void) | undefined;
|
|
27
|
+
|
|
28
|
+
const arrivals = board?.arrivals ?? [];
|
|
29
|
+
const hasArrivals = arrivals.length > 0;
|
|
30
|
+
const rows = tab === 'arrivals' ? arrivals : board?.departures ?? [];
|
|
31
|
+
const { head, rest, expanded, hasMore, toggle } = useExpandableList(rows, BOARD_COLLAPSED_COUNT);
|
|
32
|
+
|
|
33
|
+
if (!board) return null;
|
|
34
|
+
|
|
35
|
+
const airport = resolveText(board.airport, language);
|
|
36
|
+
const noun = tab === 'arrivals' ? 'arrivals' : 'departures';
|
|
37
|
+
|
|
38
|
+
const renderRow = (row: FlightRow) => {
|
|
39
|
+
const s = getFlightStatusStyle(row.status ?? FlightStatus.OnTime, theme);
|
|
40
|
+
const statusLabel = row.statusLabel ? resolveText(row.statusLabel, language) : s.label;
|
|
41
|
+
const city = resolveText(row.city, language);
|
|
42
|
+
const airline = resolveText(row.airline, language);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Pressable className="flex-row items-center gap-2 py-2.5" onPress={() => onSelectRow?.(row)}>
|
|
46
|
+
<Text className={`w-12 text-sm font-bold ${c.title}`}>{row.time}</Text>
|
|
47
|
+
|
|
48
|
+
<View className="flex-1 flex-row items-center gap-2">
|
|
49
|
+
<View
|
|
50
|
+
className="h-2 w-2 rounded-full"
|
|
51
|
+
style={{ backgroundColor: row.accent ?? c.iconColor }}
|
|
52
|
+
/>
|
|
53
|
+
<View className="flex-1">
|
|
54
|
+
<Text className={`text-sm font-semibold ${c.title}`} numberOfLines={1}>
|
|
55
|
+
{city} · {row.code}
|
|
56
|
+
</Text>
|
|
57
|
+
<Text className={`text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
58
|
+
{airline} · {row.flightNumber}
|
|
59
|
+
</Text>
|
|
60
|
+
</View>
|
|
61
|
+
</View>
|
|
62
|
+
|
|
63
|
+
<Text className={`w-10 text-center text-sm font-semibold ${c.title}`}>{row.gate ?? '—'}</Text>
|
|
64
|
+
|
|
65
|
+
<View className={`items-end rounded-full px-2 py-1 ${s.badgeBg}`}>
|
|
66
|
+
<Text className={`text-xs font-semibold ${s.badgeText}`}>{statusLabel}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
</Pressable>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<View className={`rounded-2xl border p-3 ${c.surface} ${c.border}`}>
|
|
74
|
+
<View className="flex-row items-center gap-3">
|
|
75
|
+
<View className={`h-11 w-11 items-center justify-center rounded-xl ${c.iconBg}`}>
|
|
76
|
+
<PlaneIcon size={20} color={c.iconColor} />
|
|
77
|
+
</View>
|
|
78
|
+
|
|
79
|
+
<View className="flex-1">
|
|
80
|
+
<Text className={`text-base font-bold ${c.title}`} numberOfLines={1}>
|
|
81
|
+
{airport} · {board.code}
|
|
82
|
+
</Text>
|
|
83
|
+
<View className="flex-row items-center gap-1.5">
|
|
84
|
+
{board.live ? <View className="h-1.5 w-1.5 rounded-full bg-emerald-400" /> : null}
|
|
85
|
+
<Text className={`text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
86
|
+
{board.live ? 'Live' : 'Schedule'}
|
|
87
|
+
{board.updatedAt ? ` · updated ${board.updatedAt}` : ''}
|
|
88
|
+
</Text>
|
|
89
|
+
</View>
|
|
90
|
+
</View>
|
|
91
|
+
|
|
92
|
+
{hasArrivals ? (
|
|
93
|
+
<View className="flex-row rounded-full bg-black/20 p-0.5">
|
|
94
|
+
{(['departures', 'arrivals'] as Tab[]).map((t) => (
|
|
95
|
+
<Pressable
|
|
96
|
+
key={t}
|
|
97
|
+
onPress={() => setTab(t)}
|
|
98
|
+
className={`rounded-full px-3 py-1 ${tab === t ? 'bg-indigo-500' : ''}`}
|
|
99
|
+
>
|
|
100
|
+
<Text className={`text-xs font-semibold ${tab === t ? 'text-white' : c.subtitle}`}>
|
|
101
|
+
{t === 'arrivals' ? 'Arrivals' : 'Departures'}
|
|
102
|
+
</Text>
|
|
103
|
+
</Pressable>
|
|
104
|
+
))}
|
|
105
|
+
</View>
|
|
106
|
+
) : null}
|
|
107
|
+
</View>
|
|
108
|
+
|
|
109
|
+
<View className={`my-3 h-px ${c.divider}`} />
|
|
110
|
+
|
|
111
|
+
<View className="flex-row items-center gap-2 pb-1">
|
|
112
|
+
<Text className={`w-12 text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>Time</Text>
|
|
113
|
+
<Text className={`flex-1 text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>
|
|
114
|
+
Flight · Destination
|
|
115
|
+
</Text>
|
|
116
|
+
<Text className={`w-10 text-center text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>
|
|
117
|
+
Gate
|
|
118
|
+
</Text>
|
|
119
|
+
<Text className={`text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>Status</Text>
|
|
120
|
+
</View>
|
|
121
|
+
|
|
122
|
+
{head.map((row, index) => (
|
|
123
|
+
<Fragment key={row.id}>
|
|
124
|
+
{index > 0 ? <View className={`h-px ${c.divider}`} /> : null}
|
|
125
|
+
{renderRow(row)}
|
|
126
|
+
</Fragment>
|
|
127
|
+
))}
|
|
128
|
+
|
|
129
|
+
{hasMore ? (
|
|
130
|
+
<Collapsible expanded={expanded}>
|
|
131
|
+
{rest.map((row) => (
|
|
132
|
+
<Fragment key={row.id}>
|
|
133
|
+
<View className={`h-px ${c.divider}`} />
|
|
134
|
+
{renderRow(row)}
|
|
135
|
+
</Fragment>
|
|
136
|
+
))}
|
|
137
|
+
</Collapsible>
|
|
138
|
+
) : null}
|
|
139
|
+
|
|
140
|
+
{hasMore ? (
|
|
141
|
+
<Pressable
|
|
142
|
+
onPress={toggle}
|
|
143
|
+
className={`mt-2 flex-row items-center justify-center gap-1.5 rounded-xl border py-2 ${c.actionBorder}`}
|
|
144
|
+
>
|
|
145
|
+
<Text className={`text-sm font-medium ${c.actionText}`}>
|
|
146
|
+
{expanded ? 'Show less' : `View all ${noun}`}
|
|
147
|
+
</Text>
|
|
148
|
+
<View className={expanded ? 'rotate-180' : undefined}>
|
|
149
|
+
<ChevronIcon size={16} color={c.mutedIconColor} />
|
|
150
|
+
</View>
|
|
151
|
+
</Pressable>
|
|
152
|
+
) : null}
|
|
153
|
+
</View>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Fragment, useState } from 'react';
|
|
2
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
3
|
+
import { getFlightStatusStyle } from '../../../../utils/flight.utils';
|
|
4
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
5
|
+
import { useExpandableList } from '../../../../utils/use-expandable-list';
|
|
6
|
+
import { Collapsible } from '../common/collapsible';
|
|
7
|
+
import { PlaneIcon } from '../common/plane-icon';
|
|
8
|
+
import { ChevronIcon } from '../common/chevron-icon';
|
|
9
|
+
import { FlightStatus, Theme } from '../../model/chat.model';
|
|
10
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
11
|
+
import type { FlightBoardItem, FlightRow } from './flight-board.model';
|
|
12
|
+
|
|
13
|
+
const BOARD_COLLAPSED_COUNT = 5;
|
|
14
|
+
type Tab = 'departures' | 'arrivals';
|
|
15
|
+
|
|
16
|
+
export function FlightBoard({
|
|
17
|
+
data,
|
|
18
|
+
theme = Theme.Dark,
|
|
19
|
+
language,
|
|
20
|
+
onSelect,
|
|
21
|
+
}: ChatComponentProps<FlightBoardItem>) {
|
|
22
|
+
const c = getThemeClasses(theme);
|
|
23
|
+
const board = Array.isArray(data) ? data[0] : data;
|
|
24
|
+
const [tab, setTab] = useState<Tab>('departures');
|
|
25
|
+
const onSelectRow = onSelect as ((row: FlightRow) => void) | undefined;
|
|
26
|
+
|
|
27
|
+
const arrivals = board?.arrivals ?? [];
|
|
28
|
+
const hasArrivals = arrivals.length > 0;
|
|
29
|
+
const rows = tab === 'arrivals' ? arrivals : board?.departures ?? [];
|
|
30
|
+
const { head, rest, expanded, hasMore, toggle } = useExpandableList(rows, BOARD_COLLAPSED_COUNT);
|
|
31
|
+
|
|
32
|
+
if (!board) return null;
|
|
33
|
+
|
|
34
|
+
const airport = resolveText(board.airport, language);
|
|
35
|
+
const noun = tab === 'arrivals' ? 'arrivals' : 'departures';
|
|
36
|
+
|
|
37
|
+
const renderRow = (row: FlightRow) => {
|
|
38
|
+
const s = getFlightStatusStyle(row.status ?? FlightStatus.OnTime, theme);
|
|
39
|
+
const statusLabel = row.statusLabel ? resolveText(row.statusLabel, language) : s.label;
|
|
40
|
+
const city = resolveText(row.city, language);
|
|
41
|
+
const airline = resolveText(row.airline, language);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
className="flex w-full items-center gap-2 py-2.5 text-left"
|
|
47
|
+
onClick={() => onSelectRow?.(row)}
|
|
48
|
+
>
|
|
49
|
+
<span className={`w-12 shrink-0 text-sm font-bold ${c.title}`}>{row.time}</span>
|
|
50
|
+
|
|
51
|
+
<span className="flex min-w-0 flex-1 items-center gap-2">
|
|
52
|
+
<span
|
|
53
|
+
className="h-2 w-2 shrink-0 rounded-full"
|
|
54
|
+
style={{ backgroundColor: row.accent ?? c.iconColor }}
|
|
55
|
+
/>
|
|
56
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
57
|
+
<span className={`truncate text-sm font-semibold ${c.title}`}>
|
|
58
|
+
{city} · {row.code}
|
|
59
|
+
</span>
|
|
60
|
+
<span className={`truncate text-xs ${c.subtitle}`}>
|
|
61
|
+
{airline} · {row.flightNumber}
|
|
62
|
+
</span>
|
|
63
|
+
</span>
|
|
64
|
+
</span>
|
|
65
|
+
|
|
66
|
+
<span className={`w-10 shrink-0 text-center text-sm font-semibold ${c.title}`}>{row.gate ?? '—'}</span>
|
|
67
|
+
|
|
68
|
+
<span className={`shrink-0 rounded-full px-2 py-1 text-xs font-semibold ${s.badgeBg} ${s.badgeText}`}>
|
|
69
|
+
{statusLabel}
|
|
70
|
+
</span>
|
|
71
|
+
</button>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div className={`rounded-2xl border p-3 ${c.surface} ${c.border}`}>
|
|
77
|
+
<div className="flex items-center gap-3">
|
|
78
|
+
<div className={`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${c.iconBg}`}>
|
|
79
|
+
<PlaneIcon size={20} color={c.iconColor} />
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
83
|
+
<span className={`truncate text-base font-bold ${c.title}`}>
|
|
84
|
+
{airport} · {board.code}
|
|
85
|
+
</span>
|
|
86
|
+
<span className="flex items-center gap-1.5">
|
|
87
|
+
{board.live ? <span className="h-1.5 w-1.5 rounded-full bg-emerald-400" /> : null}
|
|
88
|
+
<span className={`truncate text-xs ${c.subtitle}`}>
|
|
89
|
+
{board.live ? 'Live' : 'Schedule'}
|
|
90
|
+
{board.updatedAt ? ` · updated ${board.updatedAt}` : ''}
|
|
91
|
+
</span>
|
|
92
|
+
</span>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{hasArrivals ? (
|
|
96
|
+
<div className="flex shrink-0 rounded-full bg-black/20 p-0.5">
|
|
97
|
+
{(['departures', 'arrivals'] as Tab[]).map((t) => (
|
|
98
|
+
<button
|
|
99
|
+
key={t}
|
|
100
|
+
type="button"
|
|
101
|
+
onClick={() => setTab(t)}
|
|
102
|
+
className={`rounded-full px-3 py-1 text-xs font-semibold ${
|
|
103
|
+
tab === t ? 'bg-indigo-500 text-white' : c.subtitle
|
|
104
|
+
}`}
|
|
105
|
+
>
|
|
106
|
+
{t === 'arrivals' ? 'Arrivals' : 'Departures'}
|
|
107
|
+
</button>
|
|
108
|
+
))}
|
|
109
|
+
</div>
|
|
110
|
+
) : null}
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div className={`my-3 h-px ${c.divider}`} />
|
|
114
|
+
|
|
115
|
+
<div className="flex items-center gap-2 pb-1">
|
|
116
|
+
<span className={`w-12 shrink-0 text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>
|
|
117
|
+
Time
|
|
118
|
+
</span>
|
|
119
|
+
<span className={`flex-1 text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>
|
|
120
|
+
Flight · Destination
|
|
121
|
+
</span>
|
|
122
|
+
<span className={`w-10 shrink-0 text-center text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>
|
|
123
|
+
Gate
|
|
124
|
+
</span>
|
|
125
|
+
<span className={`text-[10px] font-semibold uppercase tracking-wide ${c.subtitle}`}>Status</span>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
{head.map((row, index) => (
|
|
129
|
+
<Fragment key={row.id}>
|
|
130
|
+
{index > 0 ? <div className={`h-px ${c.divider}`} /> : null}
|
|
131
|
+
{renderRow(row)}
|
|
132
|
+
</Fragment>
|
|
133
|
+
))}
|
|
134
|
+
|
|
135
|
+
{hasMore ? (
|
|
136
|
+
<Collapsible expanded={expanded}>
|
|
137
|
+
{rest.map((row) => (
|
|
138
|
+
<Fragment key={row.id}>
|
|
139
|
+
<div className={`h-px ${c.divider}`} />
|
|
140
|
+
{renderRow(row)}
|
|
141
|
+
</Fragment>
|
|
142
|
+
))}
|
|
143
|
+
</Collapsible>
|
|
144
|
+
) : null}
|
|
145
|
+
|
|
146
|
+
{hasMore ? (
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
onClick={toggle}
|
|
150
|
+
className={`mt-2 flex w-full items-center justify-center gap-1.5 rounded-xl border py-2 text-sm font-medium ${c.actionBorder} ${c.actionText}`}
|
|
151
|
+
>
|
|
152
|
+
{expanded ? 'Show less' : `View all ${noun}`}
|
|
153
|
+
<span className={`transition-transform ${expanded ? 'rotate-180' : ''}`}>
|
|
154
|
+
<ChevronIcon size={16} color={c.mutedIconColor} />
|
|
155
|
+
</span>
|
|
156
|
+
</button>
|
|
157
|
+
) : null}
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
}
|