@zenify-omni/chat-ui-react-js 0.1.0
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/LICENSE +21 -0
- package/README.md +92 -0
- package/assets/asset-url.js +6 -0
- package/assets/icons/chatter_agent.js +27 -0
- package/assets/icons/chatter_chatbot.js +43 -0
- package/assets/icons/chatter_contact.js +36 -0
- package/assets/icons/email_icon.png +0 -0
- package/assets/icons/emoji/angry.svg +56 -0
- package/assets/icons/emoji/haha.svg +20 -0
- package/assets/icons/emoji/like.svg +10 -0
- package/assets/icons/emoji/like_out_line.png +0 -0
- package/assets/icons/emoji/love.svg +10 -0
- package/assets/icons/emoji/sad.svg +46 -0
- package/assets/icons/emoji/wow.svg +51 -0
- package/assets/icons/instagram.js +29 -0
- package/assets/icons/not_found.png +0 -0
- package/assets/icons/not_found_template.svg +9 -0
- package/assets/icons/phone_icon.png +0 -0
- package/assets/icons/shopee.js +17 -0
- package/assets/icons/sms_icon.png +0 -0
- package/assets/icons/tiktok.js +17 -0
- package/assets/icons/whatsapp.js +28 -0
- package/assets/icons/zalo.js +17 -0
- package/assets/icons/zalo_icon.png +0 -0
- package/assets/icons/zns_icon.png +0 -0
- package/assets/images/emoji.webp +0 -0
- package/assets/images/error.png +0 -0
- package/assets/images/menu.png +0 -0
- package/assets/images/money.png +0 -0
- package/assets/images/success.png +0 -0
- package/assets/public-urls.js +78 -0
- package/components/campaign-detail-route/select/group.js +38 -0
- package/components/campaign-detail-route/select/multi-groups.js +43 -0
- package/components/chat-route/chat-box/ads-context-card.js +143 -0
- package/components/chat-route/chat-box/chat-drop-file.js +18 -0
- package/components/chat-route/chat-box/chat-feedback/chat-insight.js +214 -0
- package/components/chat-route/chat-box/chat-feedback/index.js +127 -0
- package/components/chat-route/chat-box/chat-header-actions-inline.js +1055 -0
- package/components/chat-route/chat-box/chat-header.js +465 -0
- package/components/chat-route/chat-box/chat-input.js +1164 -0
- package/components/chat-route/chat-box/chat-message-action.js +399 -0
- package/components/chat-route/chat-box/chat-message-list.js +995 -0
- package/components/chat-route/chat-box/chat-message.js +2099 -0
- package/components/chat-route/chat-box/chat-reply-preview.js +317 -0
- package/components/chat-route/chat-box/common-groups-modal.js +430 -0
- package/components/chat-route/chat-box/constants.js +29 -0
- package/components/chat-route/chat-box/contact-card/index.js +87 -0
- package/components/chat-route/chat-box/edit-customer-alias-dialog.js +197 -0
- package/components/chat-route/chat-box/emoji-picker-combined.js +91 -0
- package/components/chat-route/chat-box/emoji-sprite.js +45 -0
- package/components/chat-route/chat-box/emojiMap.js +92 -0
- package/components/chat-route/chat-box/facebook-reconnect-notice.js +49 -0
- package/components/chat-route/chat-box/forward-message-modal.js +659 -0
- package/components/chat-route/chat-box/index.js +165 -0
- package/components/chat-route/chat-box/message-time.js +44 -0
- package/components/chat-route/chat-box/message-viewers.js +114 -0
- package/components/chat-route/chat-box/pasted-file-preview.js +138 -0
- package/components/chat-route/chat-box/pinned-messages.js +255 -0
- package/components/chat-route/chat-box/react-message/react-preview.js +83 -0
- package/components/chat-route/chat-box/react-message/reaction-button.js +200 -0
- package/components/chat-route/chat-box/right-side/chat-history.js +142 -0
- package/components/chat-route/chat-box/right-side/chat-tag-selector.js +232 -0
- package/components/chat-route/chat-box/right-side/create-personal-tag-modal.js +458 -0
- package/components/chat-route/chat-box/right-side/customer/customer-info-item.js +60 -0
- package/components/chat-route/chat-box/right-side/in-room-dialog.js +225 -0
- package/components/chat-route/chat-box/right-side/zalo-group/add-friend-dialog.js +154 -0
- package/components/chat-route/chat-box/right-side/zalo-group/send-message-dialog.js +165 -0
- package/components/chat-route/chat-box/send-contact-card-modal.js +102 -0
- package/components/chat-route/chat-box/send-contact-card.js +80 -0
- package/components/chat-route/chat-box/text-content.js +400 -0
- package/components/chat-route/chat-box/use-facebook-page-invalid.js +22 -0
- package/components/chat-route/chat-box/zalo-emoji-decoration.js +98 -0
- package/components/chat-route/chat-box/zalo-emoji-picker.js +74 -0
- package/components/chat-route/chat-box/zalo-personal-editor.js +590 -0
- package/components/chat-route/chat-box/zalo-reminder/create-zalo-reminder.js +868 -0
- package/components/chat-route/chat-box/zalo-reminder/use-send-zalo-reminder.js +98 -0
- package/components/chat-route/chat-box/zalo-reminder/zalo-reminder-content.js +294 -0
- package/components/chat-route/chat-box/zalo-rtf-utils.js +422 -0
- package/components/chat-route/chat-list/action-chat-item.js +116 -0
- package/components/chat-route/chat-list/assign-agent-dialog.js +170 -0
- package/components/chat-route/chat-list/assign-tag-dialog.js +242 -0
- package/components/chat-route/chat-list/chat-item-tags.js +105 -0
- package/components/chat-route/chat-list/chat-item.js +749 -0
- package/components/chat-route/chat-list/chat-list-item.js +370 -0
- package/components/chat-route/chat-list/chat-list-selection-bar.js +426 -0
- package/components/chat-route/chat-list/chat-search-preview.js +48 -0
- package/components/chat-route/chat-list/chat-sort-menu.js +89 -0
- package/components/chat-route/chat-list/edit-filter-modal.js +468 -0
- package/components/chat-route/chat-list/filter-chat-sources.js +222 -0
- package/components/chat-route/chat-list/filter-chat.js +501 -0
- package/components/chat-route/chat-list/filter-criteria-rows.js +845 -0
- package/components/chat-route/chat-list/filter-group-select.js +66 -0
- package/components/chat-route/chat-list/filter-pin-menu.js +165 -0
- package/components/chat-route/chat-list/friend-request/list-friend-request.js +287 -0
- package/components/chat-route/chat-list/index.js +243 -0
- package/components/chat-route/chat-list/inline-search-results.js +178 -0
- package/components/chat-route/chat-list/post-ids-field.js +104 -0
- package/components/chat-route/chat-list/quick-filter-bar.js +391 -0
- package/components/chat-route/chat-list/save-filter-popover.js +258 -0
- package/components/chat-route/chat-list/search-messages/index.js +225 -0
- package/components/chat-route/chat-list/search-result-header.js +51 -0
- package/components/chat-route/chat-list/util.js +604 -0
- package/components/chat-route/chat-toolbar.js +108 -0
- package/components/chat-route/hooks/use-reassign.js +111 -0
- package/components/chat-route/shared/close-conversation-dialog.js +111 -0
- package/components/chat-route/shared/force-transfer-dialog.js +109 -0
- package/components/chat-route/shared/in-queue-confirm-dialog.js +40 -0
- package/components/chat-route/util.js +146 -0
- package/components/chat-route/zalo/modal-action-zalo.js +76 -0
- package/components/chat-route/zalo/modal-add-friend-zalo.js +277 -0
- package/components/custom/SafeHTML.js +45 -0
- package/components/custom/audio-player.js +81 -0
- package/components/custom/avatar.js +95 -0
- package/components/custom/between-date-picker/index.js +86 -0
- package/components/custom/button-close.js +28 -0
- package/components/custom/button.js +80 -0
- package/components/custom/color-picker.js +81 -0
- package/components/custom/combobox.js +168 -0
- package/components/custom/custom-dialog.js +44 -0
- package/components/custom/custom-select.js +256 -0
- package/components/custom/cycle-value-helpers.js +11 -0
- package/components/custom/cycle-value.js +93 -0
- package/components/custom/date-time-picker/components/date-time-group.js +44 -0
- package/components/custom/date-time-picker/components/date-time-input.js +383 -0
- package/components/custom/date-time-picker/components/date-time-unit-input.js +138 -0
- package/components/custom/date-time-picker/components/month-year-picker.js +232 -0
- package/components/custom/date-time-picker/hooks/use-merge-refs.js +18 -0
- package/components/custom/date-time-picker/hooks/use-scroll-to-center.js +18 -0
- package/components/custom/date-time-picker/index.js +348 -0
- package/components/custom/field-file-upload/files-upload.js +87 -0
- package/components/custom/field-file-upload/image-upload.js +115 -0
- package/components/custom/field-file-upload/preview-images-modal.js +284 -0
- package/components/custom/field-file-upload/preview-list-file.js +134 -0
- package/components/custom/field-file-upload/preview-list-image.js +108 -0
- package/components/custom/field-file-upload/upload-custom.js +222 -0
- package/components/custom/field-generator.js +639 -0
- package/components/custom/field-layout-popover.js +304 -0
- package/components/custom/file-preview-modal.js +351 -0
- package/components/custom/html-edtior.js +100 -0
- package/components/custom/icon.js +49 -0
- package/components/custom/infinite-scroll-combobox.js +253 -0
- package/components/custom/inline-edit-popover.js +90 -0
- package/components/custom/inputs/calendar-input.js +0 -0
- package/components/custom/inputs/chip-input.js +136 -0
- package/components/custom/inputs/file-input.js +71 -0
- package/components/custom/inputs/mask-data/mask-data-input.js +80 -0
- package/components/custom/inputs/mask-data/mask-data-select.js +78 -0
- package/components/custom/inputs/mask-data/mask-data-textarea.js +75 -0
- package/components/custom/inputs/mask-data/reconcile-masked-edit.js +20 -0
- package/components/custom/jxl-decode.js +34 -0
- package/components/custom/jxl-image.js +68 -0
- package/components/custom/jxl-worker.js +12 -0
- package/components/custom/label.js +55 -0
- package/components/custom/layout.js +30 -0
- package/components/custom/multi-select-search-cc.js +179 -0
- package/components/custom/multiple-select-setting-tags.js +404 -0
- package/components/custom/multiple-selector.js +821 -0
- package/components/custom/pagination.js +95 -0
- package/components/custom/popup-confirm.js +120 -0
- package/components/custom/previews/facebook/facebook-appointment-booking-preview.js +83 -0
- package/components/custom/previews/facebook/facebook-audio-preview.js +130 -0
- package/components/custom/previews/facebook/facebook-event-preview.js +72 -0
- package/components/custom/previews/facebook/facebook-file-preview.js +95 -0
- package/components/custom/previews/facebook/facebook-group-preview.js +103 -0
- package/components/custom/previews/facebook/facebook-image-preview.js +81 -0
- package/components/custom/previews/facebook/facebook-page-preview.js +85 -0
- package/components/custom/previews/facebook/facebook-post-preview.js +77 -0
- package/components/custom/previews/facebook/facebook-reel-preview.js +83 -0
- package/components/custom/previews/facebook/facebook-sticker-preview.js +23 -0
- package/components/custom/previews/facebook/facebook-video-preview.js +114 -0
- package/components/custom/previews/facebook/index.js +24 -0
- package/components/custom/previews/file-preview.js +747 -0
- package/components/custom/previews/image-preview.js +288 -0
- package/components/custom/previews/instagram/index.js +4 -0
- package/components/custom/previews/instagram/instagram-share-post-preview.js +77 -0
- package/components/custom/previews/link-preview.js +166 -0
- package/components/custom/previews/product-preview.js +334 -0
- package/components/custom/previews/tiktok-order-preview.js +278 -0
- package/components/custom/previews/tiktok-product-preview.js +321 -0
- package/components/custom/previews/tiktok-voucher-preview.js +151 -0
- package/components/custom/previews/whatsapp/index.js +10 -0
- package/components/custom/previews/whatsapp/whatsapp-contact-card-preview.js +150 -0
- package/components/custom/previews/whatsapp/whatsapp-order-preview.js +38 -0
- package/components/custom/previews/whatsapp/whatsapp-poll-preview.js +29 -0
- package/components/custom/previews/whatsapp/whatsapp-product-preview.js +29 -0
- package/components/custom/retry-image.js +44 -0
- package/components/custom/search-input.js +26 -0
- package/components/custom/separator-with-text.js +14 -0
- package/components/custom/showToast.js +21 -0
- package/components/custom/sortable-header.js +62 -0
- package/components/custom/table-resize-line.js +92 -0
- package/components/custom/time-picker/index.js +73 -0
- package/components/custom/time-picker/time-picker-input.js +159 -0
- package/components/custom/time-picker/time-picker-utils.js +152 -0
- package/components/custom/viewers/audio-player.js +192 -0
- package/components/custom/viewers/code-viewer.js +140 -0
- package/components/custom/viewers/csv-viewer.js +174 -0
- package/components/custom/viewers/docx-viewer.js +145 -0
- package/components/custom/viewers/image-viewer.js +104 -0
- package/components/custom/viewers/markdown-viewer.js +124 -0
- package/components/custom/viewers/pdf-viewer.js +333 -0
- package/components/custom/viewers/spreadsheet-viewer.js +232 -0
- package/components/custom/viewers/unsupported-viewer.js +85 -0
- package/components/custom/viewers/video-player.js +241 -0
- package/components/customers-route/change-owner-modal.js +430 -0
- package/components/customers-route/contact-note-button.js +212 -0
- package/components/customers-route/customer-source.js +37 -0
- package/components/customers-route/table/columns.js +675 -0
- package/components/customers-route/table/edit-fields.js +125 -0
- package/components/customers-route/table/editable-cell.js +218 -0
- package/components/customers-route/table/note-cell.js +77 -0
- package/components/dialogs/invite-agent.js +677 -0
- package/components/error-boundary.js +53 -0
- package/components/leads-route/duplicate-phone-warning-toast.js +96 -0
- package/components/leads-route/table/columns.js +523 -0
- package/components/leads-route/table/contact-cell-name.js +82 -0
- package/components/leads-route/table/edit-fields.js +142 -0
- package/components/leads-route/table/editable-cell.js +228 -0
- package/components/org-tree/group-name-display.js +36 -0
- package/components/org-tree/group-tree-multi-select.js +208 -0
- package/components/org-tree/group-tree-select.js +220 -0
- package/components/posts-route/dialog-select-posts.js +284 -0
- package/components/reports-route/agents/multi-select-agents.js +55 -0
- package/components/reports-route/agents/multi-select-search-agents.js +43 -0
- package/components/settings-route/chat-layout/detail/constants.js +353 -0
- package/components/settings-route/chat-layout/detail/form.js +43 -0
- package/components/settings-route/chat-timeout/channel-multi-select.js +119 -0
- package/components/settings-route/multi-channel/facebook/hooks/use-facebook-sdk.js +3 -0
- package/components/settings-route/object-rule/util.js +79 -0
- package/components/settings-route/routing/settings-dialog.js +561 -0
- package/components/settings-route/switchboard/queue-new/constant.js +9 -0
- package/components/shared/linked-customer-fields/LinkedCustomerFields.js +91 -0
- package/components/shared/linked-customer-fields/use-linked-customer-fields.js +123 -0
- package/components/smartqc-route/qc-form/controls/multi-select-search-agents.js +50 -0
- package/components/ui/alert-dialog.js +112 -0
- package/components/ui/avatar.js +44 -0
- package/components/ui/badge.js +54 -0
- package/components/ui/button.js +48 -0
- package/components/ui/calendar.js +70 -0
- package/components/ui/card.js +58 -0
- package/components/ui/carousel.js +238 -0
- package/components/ui/checkbox.js +27 -0
- package/components/ui/command.js +111 -0
- package/components/ui/context-menu.js +154 -0
- package/components/ui/dialog.js +104 -0
- package/components/ui/dropdown-menu.js +169 -0
- package/components/ui/form.js +104 -0
- package/components/ui/input.js +115 -0
- package/components/ui/label.js +20 -0
- package/components/ui/popover.js +29 -0
- package/components/ui/radio-group.js +53 -0
- package/components/ui/scroll-area.js +38 -0
- package/components/ui/select.js +147 -0
- package/components/ui/separator.js +24 -0
- package/components/ui/sheet.js +113 -0
- package/components/ui/skeleton.js +17 -0
- package/components/ui/slider.js +26 -0
- package/components/ui/sonner.js +76 -0
- package/components/ui/switch.js +54 -0
- package/components/ui/table-v2.js +269 -0
- package/components/ui/table.js +245 -0
- package/components/ui/tabs.js +89 -0
- package/components/ui/textarea.js +33 -0
- package/components/ui/tooltip.js +40 -0
- package/components/workflow-editor/nodes/ticket/picker-field.js +233 -0
- package/components/zalo-login-qr.js +237 -0
- package/components/zalo-login-status-modal.js +45 -0
- package/config/env.js +27 -0
- package/config/hmr.js +8 -0
- package/config/navigation.js +54 -0
- package/config/runtime.js +46 -0
- package/config/theme.js +274 -0
- package/constants/brand-colors.js +32 -0
- package/constants/chat-icon.js +34 -0
- package/dist/chat.css +1 -0
- package/exceptions/throw-exception.js +15 -0
- package/hooks/use-chat-attachments.js +106 -0
- package/hooks/use-chat-configs.js +62 -0
- package/hooks/use-chat-customer.js +33 -0
- package/hooks/use-chat-display-config-sync.js +72 -0
- package/hooks/use-chat-permission.js +68 -0
- package/hooks/use-chat-room-detail.js +44 -0
- package/hooks/use-chat-selection.js +26 -0
- package/hooks/use-chat-sort.js +69 -0
- package/hooks/use-chat-surface.js +8 -0
- package/hooks/use-common-filter-options.js +70 -0
- package/hooks/use-crm-organization-filter-options.js +0 -0
- package/hooks/use-crm-organizations-data.js +23 -0
- package/hooks/use-debounce.js +14 -0
- package/hooks/use-dynamic-fields.js +7 -0
- package/hooks/use-facebook-notice.js +24 -0
- package/hooks/use-feature-flags.js +6 -0
- package/hooks/use-field-layout-override.js +46 -0
- package/hooks/use-file-upload.js +119 -0
- package/hooks/use-file-viewer.js +93 -0
- package/hooks/use-frozen-columns.js +29 -0
- package/hooks/use-horizontal-scroll.js +41 -0
- package/hooks/use-image-preview-queue.js +101 -0
- package/hooks/use-inline-editable-cell.js +97 -0
- package/hooks/use-intersection-observer.js +24 -0
- package/hooks/use-interval.js +20 -0
- package/hooks/use-latest-message-id.js +13 -0
- package/hooks/use-lead-filter-options.js +0 -0
- package/hooks/use-logout-listener.js +43 -0
- package/hooks/use-org-tree.js +43 -0
- package/hooks/use-permission.js +33 -0
- package/hooks/use-quick-filters.js +175 -0
- package/hooks/use-resizable-table.js +0 -0
- package/hooks/use-setting-common.js +389 -0
- package/hooks/use-settings.js +41 -0
- package/hooks/use-sort-bindings.js +24 -0
- package/hooks/use-table-display-config.js +0 -0
- package/hooks/use-tenant-config.js +99 -0
- package/hooks/use-update-user-config.js +150 -0
- package/hooks/use-zalo-connection.js +57 -0
- package/hooks/use-zalo-mention-list.js +31 -0
- package/index.css +624 -0
- package/index.js +100 -0
- package/lib/deal-name.js +27 -0
- package/lib/i18n/react.js +7 -0
- package/lib/i18n/use-language.js +0 -0
- package/lib/query-client.js +34 -0
- package/lib/utils.js +25 -0
- package/package.json +108 -0
- package/provider/chat-context.js +9 -0
- package/provider/chat-provider.js +177 -0
- package/provider/chat-room-context.js +9 -0
- package/provider/chat-room-hooks.js +8 -0
- package/provider/chat-room-provider.js +84 -0
- package/provider/hooks.js +22 -0
- package/provider/index.js +42 -0
- package/public/contact-card-user.svg +25 -0
- package/public/images/icons/facebook.svg +1 -0
- package/public/images/icons/instagram.svg +1 -0
- package/public/images/icons/shopee.svg +1 -0
- package/public/images/icons/whatsapp.svg +1 -0
- package/public/images/icons/zalo.png +0 -0
- package/public/images/images.jpg +0 -0
- package/public/images/ticket_sources/api.png +0 -0
- package/public/images/ticket_sources/email.png +0 -0
- package/public/images/ticket_sources/facebook.png +0 -0
- package/public/images/ticket_sources/hand.png +0 -0
- package/public/images/ticket_sources/instagram.png +0 -0
- package/public/images/ticket_sources/livechat.png +0 -0
- package/public/images/ticket_sources/shopee.svg +1 -0
- package/public/images/ticket_sources/sms.png +0 -0
- package/public/images/ticket_sources/telephone-call-in.png +0 -0
- package/public/images/ticket_sources/telephone-call-out.png +0 -0
- package/public/images/ticket_sources/tiktok.png +0 -0
- package/public/images/ticket_sources/tiktok_shop.png +0 -0
- package/public/images/ticket_sources/whatsapp.png +0 -0
- package/public/images/ticket_sources/whatsapp.svg +1 -0
- package/public/images/ticket_sources/zalo.png +0 -0
- package/public/placeholder.svg +13 -0
- package/store/app-status-store.js +17 -0
- package/store/chat-display-config-store.js +182 -0
- package/store/chat-display-config.resolvers.js +88 -0
- package/store/chat-store-helpers.js +62 -0
- package/store/chat-store.js +931 -0
- package/store/crm-organization-list-filter-store.js +126 -0
- package/store/customer-list-filter-store.js +139 -0
- package/store/devtools.js +9 -0
- package/store/duplicate-phone-warning-store.js +18 -0
- package/store/entity-extract-store.js +72 -0
- package/store/file-preview-store.js +27 -0
- package/store/filter-store.js +289 -0
- package/store/index.js +22 -0
- package/store/knowledge-crawl-store.js +53 -0
- package/store/lead-list-filter-store.js +142 -0
- package/store/list-pagination-state.js +44 -0
- package/store/lumi-learn-from-chat-store.js +69 -0
- package/store/merge-suggestion-store.js +27 -0
- package/store/notification-store.js +63 -0
- package/store/preview-image-store.js +22 -0
- package/store/settings-store/multi-channel/email-list-store.js +20 -0
- package/store/settings-store/multi-channel/facebook-list-store.js +22 -0
- package/store/settings-store/multi-channel/google-list-store.js +20 -0
- package/store/settings-store/multi-channel/instagram-list-store.js +20 -0
- package/store/settings-store/multi-channel/misa-list-store.js +20 -0
- package/store/settings-store/multi-channel/nhanhvn-list-store.js +20 -0
- package/store/settings-store/multi-channel/shopee-list-store.js +20 -0
- package/store/settings-store/multi-channel/shopee-order-list-store.js +20 -0
- package/store/settings-store/multi-channel/sms-list-store.js +20 -0
- package/store/settings-store/multi-channel/tiktok-business-list-store.js +20 -0
- package/store/settings-store/multi-channel/tiktok-list-store.js +20 -0
- package/store/settings-store/multi-channel/zalo-list-store.js +22 -0
- package/store/settings-store/multi-channel/zalo-user-list-store.js +25 -0
- package/store/smart-qc-store/smart-qc-list-filter-store.js +70 -0
- package/store/tenant-config-store.js +21 -0
- package/store/user-detail-store.js +17 -0
- package/store/user-status-store.js +33 -0
- package/store/workflow-store.js +24 -0
- package/store/workspace-store.js +32 -0
- package/tailwind-preset.js +129 -0
- package/utils/chat-actions.js +414 -0
- package/utils/chat_socket.js +1225 -0
- package/utils/extra-columns.js +108 -0
- package/utils/file.js +316 -0
- package/utils/html-to-plain-text.js +12 -0
- package/utils/notification.js +71 -0
- package/utils/replaceZaloSprite.js +64 -0
- package/utils/show-be-error.js +17 -0
- package/utils/typing_socket.js +101 -0
package/store/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { create as actualCreate } from "zustand";
|
|
2
|
+
import { cloneDeep } from "lodash-es";
|
|
3
|
+
const storeResetFns = /* @__PURE__ */ new Set();
|
|
4
|
+
const resetAllStores = () => {
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
storeResetFns.forEach((resetFn) => {
|
|
7
|
+
resetFn();
|
|
8
|
+
});
|
|
9
|
+
}, 500);
|
|
10
|
+
};
|
|
11
|
+
const create = (stateCreator) => {
|
|
12
|
+
const store = actualCreate(stateCreator);
|
|
13
|
+
const initialState = store.getInitialState();
|
|
14
|
+
storeResetFns.add(() => {
|
|
15
|
+
store.setState(cloneDeep(initialState), true);
|
|
16
|
+
});
|
|
17
|
+
return store;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
create,
|
|
21
|
+
resetAllStores
|
|
22
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { create } from "./index.js";
|
|
2
|
+
import { devtools } from "zustand/middleware";
|
|
3
|
+
import { KnowledgeCrawlSocketType } from "@zenify-omni/chat-js/constants/chatbot.js";
|
|
4
|
+
const TERMINAL = [
|
|
5
|
+
KnowledgeCrawlSocketType.COMPLETED,
|
|
6
|
+
KnowledgeCrawlSocketType.FAILED
|
|
7
|
+
];
|
|
8
|
+
const useKnowledgeCrawlStore = create(
|
|
9
|
+
devtools(
|
|
10
|
+
(set) => ({
|
|
11
|
+
byKnowledge: {},
|
|
12
|
+
// payload socket: { type, user_id, data }
|
|
13
|
+
ingestEvent: ({ type, data }) => {
|
|
14
|
+
const id = data?.knowledge_id;
|
|
15
|
+
if (!type || !id) return;
|
|
16
|
+
set((state) => {
|
|
17
|
+
const prev = state.byKnowledge[id] || {};
|
|
18
|
+
if (TERMINAL.includes(prev.lastType) && type === KnowledgeCrawlSocketType.PROGRESS) {
|
|
19
|
+
return state;
|
|
20
|
+
}
|
|
21
|
+
const next = {
|
|
22
|
+
...prev,
|
|
23
|
+
lastType: type,
|
|
24
|
+
status: data?.status ?? prev.status ?? null,
|
|
25
|
+
phase: data?.phase ?? prev.phase ?? null,
|
|
26
|
+
percent: type === KnowledgeCrawlSocketType.COMPLETED ? 100 : data?.percent ?? prev.percent ?? 0,
|
|
27
|
+
processed: data?.processed ?? prev.processed ?? null,
|
|
28
|
+
total: data?.total ?? prev.total ?? null,
|
|
29
|
+
brandId: data?.brand_id ?? prev.brandId ?? null,
|
|
30
|
+
error: type === KnowledgeCrawlSocketType.FAILED ? data?.error || "unknown" : null
|
|
31
|
+
};
|
|
32
|
+
return { byKnowledge: { ...state.byKnowledge, [id]: next } };
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
// Bỏ theo dõi 1 dòng (đã refetch xong, hoặc dòng bị xoá).
|
|
36
|
+
clearKnowledge: (id) => {
|
|
37
|
+
if (!id) return;
|
|
38
|
+
set((state) => {
|
|
39
|
+
if (!state.byKnowledge[id]) return state;
|
|
40
|
+
const byKnowledge = { ...state.byKnowledge };
|
|
41
|
+
delete byKnowledge[id];
|
|
42
|
+
return { byKnowledge };
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
clearAll: () => set({ byKnowledge: {} })
|
|
46
|
+
}),
|
|
47
|
+
{ name: "knowledge-crawl-store" }
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
var knowledge_crawl_store_default = useKnowledgeCrawlStore;
|
|
51
|
+
export {
|
|
52
|
+
knowledge_crawl_store_default as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { create } from "./index.js";
|
|
2
|
+
import { devtools } from "./devtools.js";
|
|
3
|
+
import {
|
|
4
|
+
isAdmin,
|
|
5
|
+
isRoleAgent,
|
|
6
|
+
isRoleTeamLeader,
|
|
7
|
+
isSupervisor
|
|
8
|
+
} from "@zenify-omni/chat-js/utils/auth.js";
|
|
9
|
+
import { CustomerAssign } from "@zenify-omni/chat-js/constants/user.js";
|
|
10
|
+
import { DEFAULT_LEAD_COLUMN_KEYS } from "@zenify-omni/chat-js/constants/lead.js";
|
|
11
|
+
import {
|
|
12
|
+
getListPaginationState,
|
|
13
|
+
subscribeListPagination
|
|
14
|
+
} from "./list-pagination-state.js";
|
|
15
|
+
const pagination = getListPaginationState("lead", { page: 1, pageSize: 10 });
|
|
16
|
+
const getInitialAssign = () => {
|
|
17
|
+
if (isRoleTeamLeader()) return CustomerAssign.MyGroup;
|
|
18
|
+
if (isRoleAgent() || isAdmin() || isSupervisor()) return CustomerAssign.ALL;
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
21
|
+
const defaultFilterModel = {
|
|
22
|
+
fieldRelation: {
|
|
23
|
+
between: "and",
|
|
24
|
+
inner: "and"
|
|
25
|
+
},
|
|
26
|
+
fieldRule: {}
|
|
27
|
+
};
|
|
28
|
+
const defaultLeadColumnSelected = DEFAULT_LEAD_COLUMN_KEYS;
|
|
29
|
+
const useLeadListFilterStore = create(
|
|
30
|
+
devtools(
|
|
31
|
+
(set) => ({
|
|
32
|
+
assign: getInitialAssign(),
|
|
33
|
+
searchText: "",
|
|
34
|
+
page: pagination.page,
|
|
35
|
+
pageSize: pagination.pageSize,
|
|
36
|
+
filterModel: defaultFilterModel,
|
|
37
|
+
selectedFilter: null,
|
|
38
|
+
selectedColumnKeys: defaultLeadColumnSelected,
|
|
39
|
+
targetClick: null,
|
|
40
|
+
// Quick filter (sidebar "Lọc nhanh") snapshot — kept in sync with the
|
|
41
|
+
// entity-agnostic useFilterStore, mirrors ticket-list-filter-store.
|
|
42
|
+
quickFilter: {
|
|
43
|
+
filters: [],
|
|
44
|
+
conditionRelation: "and"
|
|
45
|
+
},
|
|
46
|
+
updateQuickFilter: (quickFilter) => set({ quickFilter }),
|
|
47
|
+
// Leads data state
|
|
48
|
+
totalQueriedCount: 0,
|
|
49
|
+
// Map of assign-value -> count, one entry per side-filter tab.
|
|
50
|
+
sideFilterTotal: {},
|
|
51
|
+
selectedRowKeys: {},
|
|
52
|
+
// Unified conditions (sent to BE - same pattern as deals)
|
|
53
|
+
conditions: null,
|
|
54
|
+
mainAndOr: "and",
|
|
55
|
+
subAndOr: "and",
|
|
56
|
+
setConditions: ({ conditions, mainAndOr, subAndOr }) => set({
|
|
57
|
+
conditions,
|
|
58
|
+
mainAndOr: mainAndOr || "and",
|
|
59
|
+
subAndOr: subAndOr || "and",
|
|
60
|
+
page: 1
|
|
61
|
+
}),
|
|
62
|
+
resetConditions: () => set({ conditions: null, mainAndOr: "and", subAndOr: "and" }),
|
|
63
|
+
// Smart View
|
|
64
|
+
selectedSmartView: null,
|
|
65
|
+
setSelectedSmartView: (selectedSmartView) => set({
|
|
66
|
+
selectedSmartView,
|
|
67
|
+
selectedColumnKeys: selectedSmartView?.columns?.length ? selectedSmartView.columns : defaultLeadColumnSelected,
|
|
68
|
+
// Reset sort explicit để smart-view sort áp dụng.
|
|
69
|
+
sortBy: null
|
|
70
|
+
}),
|
|
71
|
+
// Sort explicit do user click vào header. Null = rơi về smart-view/default.
|
|
72
|
+
sortBy: null,
|
|
73
|
+
setSort: (sortBy, { resetPage = true } = {}) => set(resetPage ? { sortBy, page: 1 } : { sortBy }),
|
|
74
|
+
setAssign: (assign) => {
|
|
75
|
+
set((state) => {
|
|
76
|
+
const updateState = {
|
|
77
|
+
assign,
|
|
78
|
+
page: 1
|
|
79
|
+
};
|
|
80
|
+
if (state.selectedSmartView !== null) {
|
|
81
|
+
updateState.filterModel = { ...defaultFilterModel };
|
|
82
|
+
updateState.conditions = null;
|
|
83
|
+
updateState.mainAndOr = "and";
|
|
84
|
+
updateState.subAndOr = "and";
|
|
85
|
+
}
|
|
86
|
+
return updateState;
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
setSearchText: (searchText) => {
|
|
90
|
+
set({ searchText, page: 1 });
|
|
91
|
+
},
|
|
92
|
+
setPage: (page) => set({ page }),
|
|
93
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
94
|
+
setTotalQueriedCount: (count) => set({ totalQueriedCount: count }),
|
|
95
|
+
setSideFilterTotal: (counts) => set({ sideFilterTotal: counts }),
|
|
96
|
+
setSelectedRowKeys: (updater) => set((state) => ({
|
|
97
|
+
selectedRowKeys: typeof updater === "function" ? updater(state.selectedRowKeys) : updater
|
|
98
|
+
})),
|
|
99
|
+
setFilterModel: ({ fieldRelation, fieldRule } = {}) => {
|
|
100
|
+
const validFieldRelation = fieldRelation || defaultFilterModel.fieldRelation;
|
|
101
|
+
const validFieldRule = fieldRule || defaultFilterModel.fieldRule;
|
|
102
|
+
set({
|
|
103
|
+
filterModel: {
|
|
104
|
+
fieldRelation: validFieldRelation,
|
|
105
|
+
fieldRule: validFieldRule
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
setSelectedFilter: (selectedFilter) => set({
|
|
110
|
+
selectedFilter,
|
|
111
|
+
conditions: null,
|
|
112
|
+
mainAndOr: "and",
|
|
113
|
+
subAndOr: "and",
|
|
114
|
+
sortBy: null
|
|
115
|
+
}),
|
|
116
|
+
setSelectedColumnKeys: (selectedColumnKeys) => set({ selectedColumnKeys }),
|
|
117
|
+
setTargetClick: (targetClick) => set({ targetClick }),
|
|
118
|
+
resetFilterModel: () => set({ filterModel: { ...defaultFilterModel } }),
|
|
119
|
+
setDefaults: () => {
|
|
120
|
+
set({
|
|
121
|
+
assign: getInitialAssign(),
|
|
122
|
+
searchText: "",
|
|
123
|
+
filterModel: { ...defaultFilterModel },
|
|
124
|
+
targetClick: null,
|
|
125
|
+
selectedFilter: null,
|
|
126
|
+
conditions: null,
|
|
127
|
+
mainAndOr: "and",
|
|
128
|
+
subAndOr: "and",
|
|
129
|
+
selectedSmartView: null
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
133
|
+
{
|
|
134
|
+
name: "lead-list-filter-store"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
subscribeListPagination(useLeadListFilterStore, "lead");
|
|
139
|
+
export {
|
|
140
|
+
defaultLeadColumnSelected,
|
|
141
|
+
useLeadListFilterStore
|
|
142
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const PREFIX = "crm-list-pagination:";
|
|
2
|
+
const getStorage = () => {
|
|
3
|
+
if (typeof window === "undefined") return null;
|
|
4
|
+
return window.sessionStorage;
|
|
5
|
+
};
|
|
6
|
+
const getListPaginationState = (key, defaults) => {
|
|
7
|
+
const storage = getStorage();
|
|
8
|
+
if (!storage) return defaults;
|
|
9
|
+
try {
|
|
10
|
+
const value = JSON.parse(storage.getItem(`${PREFIX}${key}`) || "null");
|
|
11
|
+
if (!value) return defaults;
|
|
12
|
+
return {
|
|
13
|
+
page: Number.isInteger(value.page) && value.page > 0 ? value.page : defaults.page,
|
|
14
|
+
pageSize: Number.isInteger(value.pageSize) && value.pageSize > 0 ? value.pageSize : defaults.pageSize
|
|
15
|
+
};
|
|
16
|
+
} catch {
|
|
17
|
+
return defaults;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const setListPaginationState = (key, pagination) => {
|
|
21
|
+
const storage = getStorage();
|
|
22
|
+
if (!storage) return;
|
|
23
|
+
try {
|
|
24
|
+
storage.setItem(`${PREFIX}${key}`, JSON.stringify(pagination));
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const subscribeListPagination = (store, key) => {
|
|
29
|
+
let previous = store.getState();
|
|
30
|
+
return store.subscribe((state) => {
|
|
31
|
+
if (state.page === previous.page && state.pageSize === previous.pageSize)
|
|
32
|
+
return;
|
|
33
|
+
previous = state;
|
|
34
|
+
setListPaginationState(key, {
|
|
35
|
+
page: state.page,
|
|
36
|
+
pageSize: state.pageSize
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
getListPaginationState,
|
|
42
|
+
setListPaginationState,
|
|
43
|
+
subscribeListPagination
|
|
44
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import i18n from "@zenify-omni/chat-js/lib/i18n/index.js";
|
|
2
|
+
import { create } from "./index.js";
|
|
3
|
+
import { devtools } from "./devtools.js";
|
|
4
|
+
import { LumiSocketType } from "@zenify-omni/chat-js/constants/chatbot.js";
|
|
5
|
+
const useLumiLearnFromChatStore = create(
|
|
6
|
+
devtools(
|
|
7
|
+
(set) => ({
|
|
8
|
+
byBot: {},
|
|
9
|
+
// payload socket: { type, bot_id, data }
|
|
10
|
+
ingestEvent: ({ type, bot_id: botId, data }) => {
|
|
11
|
+
if (!type || !botId) return;
|
|
12
|
+
set((state) => {
|
|
13
|
+
const prev = state.byBot[botId] || {};
|
|
14
|
+
const next = {
|
|
15
|
+
...prev,
|
|
16
|
+
lastType: type,
|
|
17
|
+
...data?.status !== void 0 ? { status: data.status } : {}
|
|
18
|
+
};
|
|
19
|
+
if (type === LumiSocketType.ANALYSIS_RESULT) {
|
|
20
|
+
next.analysis = {
|
|
21
|
+
status: data?.status,
|
|
22
|
+
metrics: data?.metrics || {}
|
|
23
|
+
};
|
|
24
|
+
} else if (type === LumiSocketType.PROCESS_PROGRESS) {
|
|
25
|
+
next.process = {
|
|
26
|
+
percent: data?.percent ?? 0,
|
|
27
|
+
steps: data?.steps || []
|
|
28
|
+
};
|
|
29
|
+
next.error = null;
|
|
30
|
+
} else if (type === LumiSocketType.PROCESS_COMPLETED) {
|
|
31
|
+
next.process = {
|
|
32
|
+
percent: 100,
|
|
33
|
+
// Giữ steps cuối (completed không kèm steps) nhưng ép completed hết
|
|
34
|
+
steps: (prev.process?.steps || []).map((step) => ({
|
|
35
|
+
...step,
|
|
36
|
+
status: "completed"
|
|
37
|
+
}))
|
|
38
|
+
};
|
|
39
|
+
next.botinfo = data?.botinfo || {};
|
|
40
|
+
next.error = null;
|
|
41
|
+
} else if (type === LumiSocketType.PROCESS_FAILED) {
|
|
42
|
+
next.error = data?.error || {
|
|
43
|
+
message: i18n.t("common:status.analysisFailed", {
|
|
44
|
+
defaultValue: "Ph\xE2n t\xEDch th\u1EA5t b\u1EA1i"
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return { byBot: { ...state.byBot, [botId]: next } };
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
// Reset state 1 bot (khi re-trigger đánh giá lại / reject)
|
|
52
|
+
clearBot: (botId) => {
|
|
53
|
+
if (!botId) return;
|
|
54
|
+
set((state) => {
|
|
55
|
+
if (!state.byBot[botId]) return state;
|
|
56
|
+
const byBot = { ...state.byBot };
|
|
57
|
+
delete byBot[botId];
|
|
58
|
+
return { byBot };
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
clearAll: () => set({ byBot: {} })
|
|
62
|
+
}),
|
|
63
|
+
{ name: "lumi-learn-from-chat-store" }
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
var lumi_learn_from_chat_store_default = useLumiLearnFromChatStore;
|
|
67
|
+
export {
|
|
68
|
+
lumi_learn_from_chat_store_default as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { create } from "./index.js";
|
|
2
|
+
import { devtools } from "./devtools.js";
|
|
3
|
+
const useMergeSuggestionStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
isOpen: false,
|
|
7
|
+
// mergeData shape — khớp với response của API getConflictFields:
|
|
8
|
+
// {
|
|
9
|
+
// phone: string, // SĐT trùng (caller tự truyền)
|
|
10
|
+
// contact_a: { _id, name, crm_type }, // hồ sơ đang thao tác
|
|
11
|
+
// contact_b: { _id, name, crm_type }, // hồ sơ đã tồn tại
|
|
12
|
+
// crm_type_result: 'contact' | 'lead',
|
|
13
|
+
// conflicts: [{ field, label, value_a, value_b, type? }]
|
|
14
|
+
// }
|
|
15
|
+
mergeData: null,
|
|
16
|
+
onConfirm: null,
|
|
17
|
+
// (selections: { [field]: 'a' | 'b' }) => void
|
|
18
|
+
open: (mergeData, onConfirm) => set({ isOpen: true, mergeData, onConfirm }),
|
|
19
|
+
close: () => set({ isOpen: false, mergeData: null, onConfirm: null })
|
|
20
|
+
}),
|
|
21
|
+
{ name: "merge-suggestion-store" }
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
var merge_suggestion_store_default = useMergeSuggestionStore;
|
|
25
|
+
export {
|
|
26
|
+
merge_suggestion_store_default as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { create } from "./index.js";
|
|
2
|
+
import { devtools } from "./devtools.js";
|
|
3
|
+
const dedup = (list) => {
|
|
4
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5
|
+
const result = [];
|
|
6
|
+
for (const item of list) {
|
|
7
|
+
if (item?._id != null) {
|
|
8
|
+
if (seen.has(item._id)) continue;
|
|
9
|
+
seen.add(item._id);
|
|
10
|
+
}
|
|
11
|
+
result.push(item);
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
const notificationStore = create(
|
|
16
|
+
devtools(
|
|
17
|
+
(set) => ({
|
|
18
|
+
isNotificationSocketConnected: false,
|
|
19
|
+
isNotificationListLoading: true,
|
|
20
|
+
isNewNotification: /* @__PURE__ */ new Date(),
|
|
21
|
+
unreadCount: 0,
|
|
22
|
+
notifications: [],
|
|
23
|
+
unreadNotifications: [],
|
|
24
|
+
skipFromId: "",
|
|
25
|
+
setIsSocketConnected: (isConnected) => set({ isNotificationSocketConnected: isConnected }),
|
|
26
|
+
setIsNotificationListLoading: (isLoading) => set({ isNotificationListLoading: isLoading }),
|
|
27
|
+
setUnreadCount: (count) => set({ unreadCount: count }),
|
|
28
|
+
addUnreadCount: (count) => {
|
|
29
|
+
set((state) => ({
|
|
30
|
+
unreadCount: state.unreadCount + count
|
|
31
|
+
}));
|
|
32
|
+
},
|
|
33
|
+
setNotification: (data) => set({ notifications: dedup(data) }),
|
|
34
|
+
setUnreadNotifications: (data) => set({ unreadNotifications: dedup(data) }),
|
|
35
|
+
addNotification: (data) => {
|
|
36
|
+
set((state) => ({
|
|
37
|
+
notifications: dedup([{ ...data }, ...state.notifications]),
|
|
38
|
+
isNewNotification: /* @__PURE__ */ new Date()
|
|
39
|
+
}));
|
|
40
|
+
},
|
|
41
|
+
addUnreadNotifications: (data) => {
|
|
42
|
+
set((state) => ({
|
|
43
|
+
unreadNotifications: dedup([
|
|
44
|
+
...state.unreadNotifications,
|
|
45
|
+
{ ...data }
|
|
46
|
+
])
|
|
47
|
+
}));
|
|
48
|
+
},
|
|
49
|
+
removeNotification: (index) => {
|
|
50
|
+
set((state) => ({
|
|
51
|
+
notifications: state.notifications.filter((_, i) => i !== index)
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
{
|
|
56
|
+
name: "notification-store"
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
var notification_store_default = notificationStore;
|
|
61
|
+
export {
|
|
62
|
+
notification_store_default as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { create } from "./index.js";
|
|
2
|
+
import { devtools } from "./devtools.js";
|
|
3
|
+
const usePreviewImageStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
modalImages: [],
|
|
7
|
+
previewModal: {
|
|
8
|
+
isOpen: false,
|
|
9
|
+
currentIndex: 0
|
|
10
|
+
},
|
|
11
|
+
setModalImages: (modalImages) => set({ modalImages }),
|
|
12
|
+
setPreviewModal: (previewModal) => set({ previewModal })
|
|
13
|
+
}),
|
|
14
|
+
{
|
|
15
|
+
name: "preview-image-store"
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
var preview_image_store_default = usePreviewImageStore;
|
|
20
|
+
export {
|
|
21
|
+
preview_image_store_default as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useEmailListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "email-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useEmailListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useFacebookListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
reloadTime: null,
|
|
9
|
+
sortBy: null,
|
|
10
|
+
setPage: (page) => set({ page }),
|
|
11
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
12
|
+
setReloadTime: (reloadTime) => set({ reloadTime }),
|
|
13
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
14
|
+
}),
|
|
15
|
+
{
|
|
16
|
+
name: "facebook-list-store"
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
useFacebookListStore
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useGoogleListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "google-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useGoogleListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useInstagramListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "instagram-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useInstagramListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useMisaListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "misa-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useMisaListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useNhanhvnListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "nhanhvn-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useNhanhvnListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useShopeeListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "shopee-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useShopeeListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useShopeeOrderListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "shopee-order-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useShopeeOrderListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useSMSListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "sms-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useSMSListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useTiktokBusinessListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "tiktok-business-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useTiktokBusinessListStore
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { create } from "../../index.js";
|
|
2
|
+
import { devtools } from "../../devtools.js";
|
|
3
|
+
const useTiktokListStore = create(
|
|
4
|
+
devtools(
|
|
5
|
+
(set) => ({
|
|
6
|
+
page: 1,
|
|
7
|
+
pageSize: 10,
|
|
8
|
+
sortBy: null,
|
|
9
|
+
setPage: (page) => set({ page }),
|
|
10
|
+
setPageSize: (pageSize) => set({ pageSize }),
|
|
11
|
+
setSort: (sortBy) => set({ sortBy, page: 1 })
|
|
12
|
+
}),
|
|
13
|
+
{
|
|
14
|
+
name: "tiktok-list-store"
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
useTiktokListStore
|
|
20
|
+
};
|