impact-ui 3.7.25 → 4.0.0-alpha.10
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/MIGRATION_GUIDE.md +328 -0
- package/README.md +154 -15
- package/bin/migrate-image-paths.cjs +127 -0
- package/bin/migrate.js +293 -0
- package/codemods/component-map.js +153 -0
- package/codemods/image-paths-transform.js +69 -0
- package/codemods/transform.js +136 -0
- package/dist/components/Accordion/index.js +2 -1
- package/dist/components/AccordionModern/index.js +2 -1
- package/dist/components/Alert/index.js +2 -1
- package/dist/components/Avatar/index.js +2 -1
- package/dist/components/Badge/filled/filledIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/filled/filledOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/filled/filledOnlyLabelBadges/index.js +2 -1
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Badge/stroke/strokeIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.js +2 -1
- package/dist/components/BottomSheet/index.js +2 -1
- package/dist/components/Breadcrumbs/index.js +2 -1
- package/dist/components/Button/index.js +2 -1
- package/dist/components/ButtonGroup/index.js +2 -1
- package/dist/components/Card/index.js +2 -1
- package/dist/components/Chart/index.js +2 -1
- package/dist/components/Chatbot/index.js +2 -1
- package/dist/components/Checkbox/index.js +2 -1
- package/dist/components/Chips/index.js +2 -1
- package/dist/components/CreateItemFlow/index.js +2 -1
- package/dist/components/DatePicker/datePickerDropdown.js +2 -1
- package/dist/components/DatePicker/index.js +3 -2
- package/dist/components/DateRangePicker/dateRangePickerDropdown.js +2 -1
- package/dist/components/DateRangePicker/index.js +3 -2
- package/dist/components/DynamicLayout/index.js +2 -1
- package/dist/components/EmptyState/EmptyStateImage.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyStateImage.js +3 -2
- package/dist/components/EmptyState/index.js +2 -1
- package/dist/components/FileUpload/index.js +2 -1
- package/dist/components/FilterPanel/index.js +2 -1
- package/dist/components/FiltersStrip/index.js +2 -1
- package/dist/components/Header/index.js +2 -1
- package/dist/components/HomePage/index.js +2 -1
- package/dist/components/Input/index.js +2 -1
- package/dist/components/Loader/index.js +2 -1
- package/dist/components/Menu/IconMenuItem.js +2 -1
- package/dist/components/Menu/MenuHeaderInfo.js +2 -1
- package/dist/components/Menu/NestedMenuItem.js +2 -1
- package/dist/components/Menu/index.js +2 -1
- package/dist/components/Menu/nestedMenuItemsFromObject.js +2 -1
- package/dist/components/Modal/index.js +2 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +2 -1
- package/dist/components/Notification/index.js +2 -1
- package/dist/components/Panel/index.js +2 -1
- package/dist/components/Popover/index.js +2 -1
- package/dist/components/ProgressBar/index.js +2 -1
- package/dist/components/Prompt/index.js +2 -1
- package/dist/components/RadioButtonGroup/index.js +2 -1
- package/dist/components/Select/index.js +2 -1
- package/dist/components/Sidebar/index.js +2 -1
- package/dist/components/Slider/index.js +2 -1
- package/dist/components/Stepper/index.js +2 -1
- package/dist/components/Switch/index.js +2 -1
- package/dist/components/Table/TableImpl.js +4 -3
- package/dist/components/TableChat/EmptyContainer.js +2 -1
- package/dist/components/TableChat/TableChatSidePanel.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.js +2 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +2 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +2 -1
- package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +2 -1
- package/dist/components/TableChat/components/TextEditor/Mention.js +2 -1
- package/dist/components/TableChat/components/TextEditor/MentionList.js +2 -1
- package/dist/components/Tabs/index.js +2 -1
- package/dist/components/Tag/index.js +2 -1
- package/dist/components/TagGroup/index.js +2 -1
- package/dist/components/TextArea/index.js +2 -1
- package/dist/components/Toast/index.js +2 -1
- package/dist/components/Tooltip/index.js +2 -1
- package/dist/components/common/HelperText/index.js +2 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/mcp-component-registry.json +1 -1
- package/dist/styles/entry.d.ts +2 -0
- package/dist/styles/entry.d.ts.map +1 -0
- package/dist/styles/entry.js +1 -0
- package/dist/styles/style.css +1 -1
- package/eslint-plugin/index.js +91 -0
- package/eslint-plugin/rules/no-barrel-import.js +224 -0
- package/package.json +153 -89
- package/dist/0db32db10ae1525f.svg +0 -9
- package/dist/2bc76319b1fa572e.svg +0 -9
- package/dist/39d49e4daed1a992.svg +0 -9
- package/dist/44beedf64dc29d19.svg +0 -9
- package/dist/49a4f914058314f1.svg +0 -9
- package/dist/6fc8a59d621a04a1.svg +0 -13
- package/dist/78f845dcfc981491.svg +0 -9
- package/dist/b31c0c2a19c1c19a.svg +0 -9
- package/dist/index.js +0 -308
- package/dist/index.js.map +0 -1
- package/src/components/Accordion/Accordion.styles.scss +0 -118
- package/src/components/Accordion/index.js +0 -104
- package/src/components/AccordionModern/AccordionModern.styles.scss +0 -121
- package/src/components/AccordionModern/SortableAccordionComp.js +0 -156
- package/src/components/AccordionModern/index.js +0 -103
- package/src/components/Alert/Alert.styles.scss +0 -131
- package/src/components/Alert/index.js +0 -71
- package/src/components/Avatar/Avatar.styles.scss +0 -25
- package/src/components/Avatar/index.js +0 -58
- package/src/components/Badge/Badges.style.scss +0 -55
- package/src/components/Badge/filled/filledIconLabelBadges/filledIconLabelBadges.styles.scss +0 -32
- package/src/components/Badge/filled/filledIconLabelBadges/index.js +0 -38
- package/src/components/Badge/filled/filledOnlyIconBadges/filledOnlyIconBadges.styles.scss +0 -26
- package/src/components/Badge/filled/filledOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/filled/filledOnlyLabelBadges/filledOnlyLabelBadges.styles.scss +0 -66
- package/src/components/Badge/filled/filledOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/filled/index.js +0 -30
- package/src/components/Badge/index.js +0 -53
- package/src/components/Badge/stroke/index.js +0 -43
- package/src/components/Badge/stroke/strokeIconLabelBadges/index.js +0 -38
- package/src/components/Badge/stroke/strokeIconLabelBadges/strokeIconLabelBadges.styles.scss +0 -33
- package/src/components/Badge/stroke/strokeOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/stroke/strokeOnlyIconBadges/strokeOnlyIconBadges.styles.scss +0 -27
- package/src/components/Badge/stroke/strokeOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/stroke/strokeOnlyLabelBadges/strokeOnlyLabelBadges.styles.scss +0 -89
- package/src/components/Badge/styles.css +0 -52
- package/src/components/Badge/subtle/index.js +0 -41
- package/src/components/Badge/subtle/subtleIOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/subtle/subtleIOnlyIconBadges/subtleIOnlyIconBadges.scss +0 -26
- package/src/components/Badge/subtle/subtleIconLabelBadges/index.js +0 -38
- package/src/components/Badge/subtle/subtleIconLabelBadges/subtleIconLabelBadges.scss +0 -56
- package/src/components/Badge/subtle/subtleOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/subtle/subtleOnlyLabelBadges/subtleOnlyLabelBadges.scss +0 -70
- package/src/components/BottomSheet/BottomSheet.styles.scss +0 -46
- package/src/components/BottomSheet/index.js +0 -60
- package/src/components/Breadcrumbs/Breadcrumbs.styles.scss +0 -65
- package/src/components/Breadcrumbs/index.js +0 -121
- package/src/components/Button/Button.styles.scss +0 -345
- package/src/components/Button/index.js +0 -171
- package/src/components/ButtonGroup/ButtonGroup.styles.scss +0 -125
- package/src/components/ButtonGroup/index.js +0 -84
- package/src/components/Card/Card.styles.scss +0 -33
- package/src/components/Card/index.js +0 -21
- package/src/components/Chart/Chart.style.scss +0 -142
- package/src/components/Chart/index.js +0 -752
- package/src/components/ChatBot/bookMarkPanel.js +0 -74
- package/src/components/ChatBot/chatBot.style.scss +0 -1295
- package/src/components/ChatBot/chatBotFooter.js +0 -14
- package/src/components/ChatBot/chatBotLandingScreen.js +0 -26
- package/src/components/ChatBot/chatInput.js +0 -206
- package/src/components/ChatBot/chatbotModuleMenu.js +0 -278
- package/src/components/ChatBot/constant.js +0 -32
- package/src/components/ChatBot/conversationScreen.js +0 -281
- package/src/components/ChatBot/customScreen.js +0 -69
- package/src/components/ChatBot/historyPanel.js +0 -579
- package/src/components/ChatBot/index.js +0 -473
- package/src/components/ChatBot/newChatComponent.js +0 -105
- package/src/components/ChatBot/utils.js +0 -27
- package/src/components/Checkbox/Checkbox.styles.scss +0 -232
- package/src/components/Checkbox/dashed/index.js +0 -34
- package/src/components/Checkbox/default/index.js +0 -70
- package/src/components/Checkbox/index.js +0 -50
- package/src/components/Checkbox/withDropDown/index.js +0 -96
- package/src/components/Checkbox/withoutFormLabel/index.js +0 -46
- package/src/components/Chips/Chip.style.scss +0 -134
- package/src/components/Chips/index.js +0 -34
- package/src/components/CreateItemFlow/CreateItemFlow.styles.scss +0 -37
- package/src/components/CreateItemFlow/index.js +0 -145
- package/src/components/DatePicker/DatePicker.styles.scss +0 -519
- package/src/components/DatePicker/datePickerDropdown.js +0 -282
- package/src/components/DatePicker/datePickerFooter.js +0 -76
- package/src/components/DatePicker/datePickerInput.js +0 -333
- package/src/components/DatePicker/index.js +0 -288
- package/src/components/DatePicker/showMonthYearSelect.js +0 -119
- package/src/components/DateRangePicker/DateRangePicker.styles.scss +0 -635
- package/src/components/DateRangePicker/dateRangePickerCustom.js +0 -22
- package/src/components/DateRangePicker/dateRangePickerDropdown.js +0 -320
- package/src/components/DateRangePicker/dateRangePickerFooter.js +0 -50
- package/src/components/DateRangePicker/dateRangePickerInput.js +0 -544
- package/src/components/DateRangePicker/index.js +0 -393
- package/src/components/DateRangePicker/showMonthYearSelect.js +0 -103
- package/src/components/DateRangePicker/utils.js +0 -71
- package/src/components/DynamicLayout/DynamicLayout.styles.scss +0 -153
- package/src/components/DynamicLayout/index.js +0 -73
- package/src/components/EmptyState/EmptyState.styles.scss +0 -88
- package/src/components/EmptyState/EmptyStateImageComponent.jsx +0 -36
- package/src/components/EmptyState/index.js +0 -54
- package/src/components/FileUpload/FileUpload.styles.scss +0 -449
- package/src/components/FileUpload/index.js +0 -641
- package/src/components/FilterPanel/FilterPanel.styles.scss +0 -241
- package/src/components/FilterPanel/FilterPanelHeader.js +0 -15
- package/src/components/FilterPanel/PanelFooter.js +0 -65
- package/src/components/FilterPanel/PanelSidebar.js +0 -85
- package/src/components/FilterPanel/index.js +0 -147
- package/src/components/FiltersStrip/FiltersStrip.styles.scss +0 -343
- package/src/components/FiltersStrip/Slider/FilterSlider.styles.scss +0 -85
- package/src/components/FiltersStrip/Slider/Portal.js +0 -59
- package/src/components/FiltersStrip/Slider/index.js +0 -233
- package/src/components/FiltersStrip/appliedFilter.js +0 -180
- package/src/components/FiltersStrip/filterDropDown.js +0 -96
- package/src/components/FiltersStrip/index.js +0 -127
- package/src/components/FiltersStrip/mockData.js +0 -227
- package/src/components/Header/Header.styles.scss +0 -223
- package/src/components/Header/index.js +0 -156
- package/src/components/HomePage/HomePage.styles.scss +0 -1638
- package/src/components/HomePage/constant.js +0 -331
- package/src/components/HomePage/index.js +0 -675
- package/src/components/Input/Input.styles.scss +0 -318
- package/src/components/Input/helperText.js +0 -19
- package/src/components/Input/index.js +0 -60
- package/src/components/Input/inputWithIcon.js +0 -134
- package/src/components/Input/vanilaInput.js +0 -68
- package/src/components/Loader/Loader.styles.scss +0 -90
- package/src/components/Loader/index.js +0 -69
- package/src/components/Menu/IconMenuItem.js +0 -100
- package/src/components/Menu/Menu.styles.scss +0 -190
- package/src/components/Menu/MenuHeader.jsx +0 -84
- package/src/components/Menu/MenuHeaderInfo.jsx +0 -319
- package/src/components/Menu/MenuHeaderInfo.styles.scss +0 -123
- package/src/components/Menu/NestedMenuItem.js +0 -189
- package/src/components/Menu/index.js +0 -254
- package/src/components/Menu/nestedMenuItemsFromObject.js +0 -100
- package/src/components/Modal/Modal.styles.scss +0 -129
- package/src/components/Modal/index.js +0 -141
- package/src/components/MonthPicker/MonthPicker.styles.scss +0 -255
- package/src/components/MonthPicker/constant.js +0 -1
- package/src/components/MonthPicker/index.js +0 -373
- package/src/components/MonthRangePicker/MonthRangePicker.styles.scss +0 -383
- package/src/components/MonthRangePicker/constant.js +0 -1
- package/src/components/MonthRangePicker/index.js +0 -574
- package/src/components/Notification/Notification.styles.scss +0 -594
- package/src/components/Notification/NotificationBody/NotificationInfoList/chipsLists.js +0 -144
- package/src/components/Notification/NotificationBody/NotificationInfoList/index.js +0 -128
- package/src/components/Notification/NotificationBody/NotificationInfoList/notificationList.js +0 -165
- package/src/components/Notification/NotificationBody/NotificationPanels/chipsLists.js +0 -85
- package/src/components/Notification/NotificationBody/NotificationPanels/index.js +0 -259
- package/src/components/Notification/NotificationBody/NotificationPanels/notificationList.js +0 -637
- package/src/components/Notification/NotificationBody/index.js +0 -117
- package/src/components/Notification/index.js +0 -128
- package/src/components/Notification/mockData.js +0 -389
- package/src/components/Notification/notificationFooter.js +0 -31
- package/src/components/Notification/notificationHeader.js +0 -28
- package/src/components/Panel/Panel.styles.scss +0 -71
- package/src/components/Panel/index.js +0 -144
- package/src/components/Popover/Popover.styles.scss +0 -52
- package/src/components/Popover/index.js +0 -71
- package/src/components/Portal/index.js +0 -31
- package/src/components/ProgressBar/ProgressBar.styles.scss +0 -62
- package/src/components/ProgressBar/index.js +0 -40
- package/src/components/Prompt/Prompt.styles.scss +0 -107
- package/src/components/Prompt/index.js +0 -107
- package/src/components/RadioButtonGroup/RadioButtonGroup.styles.scss +0 -136
- package/src/components/RadioButtonGroup/index.js +0 -107
- package/src/components/Select/SearchFilter.js +0 -72
- package/src/components/Select/Select.styles.scss +0 -748
- package/src/components/Select/customGroupHeading.js +0 -24
- package/src/components/Select/dropdown.js +0 -65
- package/src/components/Select/hooks/index.js +0 -2
- package/src/components/Select/hooks/useClickOutside.js +0 -61
- package/src/components/Select/hooks/useMenuPosition.js +0 -288
- package/src/components/Select/index.js +0 -1307
- package/src/components/Select/menuList.js +0 -119
- package/src/components/Select/optionList.js +0 -215
- package/src/components/Select/selected-option-tags.js +0 -99
- package/src/components/Select/utils.js +0 -232
- package/src/components/Sidebar/Menus/childMenu.js +0 -88
- package/src/components/Sidebar/Menus/index.js +0 -130
- package/src/components/Sidebar/Menus/parentMenu.js +0 -173
- package/src/components/Sidebar/Sidebar.styles.scss +0 -411
- package/src/components/Sidebar/actions.js +0 -31
- package/src/components/Sidebar/index.js +0 -84
- package/src/components/Sidebar/mock.js +0 -202
- package/src/components/Slider/Sliders.styles.scss +0 -260
- package/src/components/Slider/index.js +0 -314
- package/src/components/Stepper/Stepper.styles.scss +0 -355
- package/src/components/Stepper/index.js +0 -101
- package/src/components/Switch/Switch.styles.scss +0 -96
- package/src/components/Switch/index.js +0 -59
- package/src/components/Table/AdvanceSearchModalItem.js +0 -392
- package/src/components/Table/AdvanceSortModal.js +0 -332
- package/src/components/Table/AgGridHeader.js +0 -1009
- package/src/components/Table/CommentsPortal.js +0 -428
- package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.js +0 -323
- package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +0 -476
- package/src/components/Table/NoComments.js +0 -295
- package/src/components/Table/Table.styles.scss +0 -3859
- package/src/components/Table/actionBar.js +0 -43
- package/src/components/Table/advanceSearchModal.js +0 -797
- package/src/components/Table/commentPanel.js +0 -421
- package/src/components/Table/filterUtils.js +0 -850
- package/src/components/Table/index.js +0 -2175
- package/src/components/Table/mockData.js +0 -1344
- package/src/components/Table/tableFunctions.js +0 -1676
- package/src/components/Table/tableHeader.js +0 -476
- package/src/components/Table/tableIcons.js +0 -61
- package/src/components/Table/tableMoreOptions.js +0 -293
- package/src/components/Table/tablePagination.js +0 -63
- package/src/components/Table/tableSettings.js +0 -287
- package/src/components/Table/withCommentIcon.js +0 -107
- package/src/components/TableChat/EmptyContainer.jsx +0 -13
- package/src/components/TableChat/README.md +0 -588
- package/src/components/TableChat/TableChatSidePanel.jsx +0 -832
- package/src/components/TableChat/TableChatSidePanel.styles.scss +0 -57
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.jsx +0 -43
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.jsx +0 -55
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.jsx +0 -94
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.jsx +0 -22
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.scss +0 -179
- package/src/components/TableChat/components/SkeletonList.jsx +0 -12
- package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.jsx +0 -171
- package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.styles.scss +0 -37
- package/src/components/TableChat/components/TableChatLeftSection/ChannelCheckbox/ChannelCheckbox.jsx +0 -28
- package/src/components/TableChat/components/TableChatLeftSection/ChatChannelItem.jsx +0 -116
- package/src/components/TableChat/components/TableChatLeftSection/ChatChannelList.jsx +0 -89
- package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.jsx +0 -27
- package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.jsx +0 -191
- package/src/components/TableChat/components/TableChatLeftSection/ChatIconButton/ChatIconButton.jsx +0 -23
- package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.jsx +0 -117
- package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.styles.scss +0 -469
- package/src/components/TableChat/components/TableChatLeftSection/UnreadBadge/UnreadBadge.jsx +0 -16
- package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.jsx +0 -119
- package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.styles.scss +0 -87
- package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.jsx +0 -216
- package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.styles.scss +0 -291
- package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.jsx +0 -19
- package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/DeletedMessage.styles.scss +0 -55
- package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.jsx +0 -61
- package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.styles.scss +0 -13
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.jsx +0 -432
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.jsx +0 -365
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.jsx +0 -42
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/chatHeader.styles.scss +0 -323
- package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.jsx +0 -793
- package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.styles.scss +0 -394
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.jsx +0 -61
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.styles.scss +0 -28
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.jsx +0 -11
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.styles.scss +0 -3
- package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.jsx +0 -220
- package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.styles.scss +0 -128
- package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.jsx +0 -246
- package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.styles.scss +0 -210
- package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.jsx +0 -52
- package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.styles.scss +0 -34
- package/src/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.jsx +0 -31
- package/src/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.jsx +0 -170
- package/src/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.jsx +0 -165
- package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChat.styles.scss +0 -587
- package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.jsx +0 -244
- package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.jsx +0 -29
- package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.styles.scss +0 -47
- package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.jsx +0 -1340
- package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.styles.scss +0 -147
- package/src/components/TableChat/components/TextEditor/EditorToolbar.jsx +0 -209
- package/src/components/TableChat/components/TextEditor/EditorToolbar.styles.scss +0 -61
- package/src/components/TableChat/components/TextEditor/Mention.jsx +0 -234
- package/src/components/TableChat/components/TextEditor/MentionList.jsx +0 -118
- package/src/components/TableChat/components/TextEditor/MentionList.scss +0 -146
- package/src/components/TableChat/components/TextEditor/styles.scss +0 -278
- package/src/components/TableChat/components/TextEditor/suggestion.js +0 -124
- package/src/components/TableChat/components/chatConfig.js +0 -64
- package/src/components/TableChat/hooks/useInfiniteScroll.js +0 -256
- package/src/components/TableOld/AgGridHeader.js +0 -545
- package/src/components/TableOld/Table.styles.scss +0 -2192
- package/src/components/TableOld/actionBar.js +0 -43
- package/src/components/TableOld/index.js +0 -598
- package/src/components/TableOld/mockData.js +0 -1344
- package/src/components/TableOld/tableFunctions.js +0 -1734
- package/src/components/TableOld/tableHeader.js +0 -251
- package/src/components/TableOld/tableIcons.js +0 -61
- package/src/components/TableOld/tablePagination.js +0 -64
- package/src/components/TableOld/tableSettings.js +0 -166
- package/src/components/Tabs/Tabs.styles.scss +0 -120
- package/src/components/Tabs/index.js +0 -91
- package/src/components/Tabs/tabPanel.js +0 -38
- package/src/components/Tag/Tags.styles.scss +0 -71
- package/src/components/Tag/filled.js +0 -48
- package/src/components/Tag/index.js +0 -54
- package/src/components/Tag/solid.js +0 -47
- package/src/components/Tag/stroke.js +0 -47
- package/src/components/Tag/utils.js +0 -12
- package/src/components/TagGroup/TagGroup.styles.scss +0 -7
- package/src/components/TagGroup/index.js +0 -6
- package/src/components/TextArea/TextArea.styles.scss +0 -158
- package/src/components/TextArea/index.js +0 -121
- package/src/components/Toast/Toast.styles.scss +0 -66
- package/src/components/Toast/index.js +0 -35
- package/src/components/Tooltip/Tooltips.styles.scss +0 -111
- package/src/components/Tooltip/index.js +0 -68
- package/src/components/common/HelperText/HelperText.styles.scss +0 -18
- package/src/components/common/HelperText/index.js +0 -44
- package/src/components/common/MentionEditor/MentionEditor.styles.scss +0 -301
- package/src/components/common/MentionEditor/MentionList/MentionList.styles.scss +0 -146
- package/src/components/common/MentionEditor/MentionList/index.js +0 -130
- package/src/components/common/MentionEditor/index.js +0 -246
- package/src/components/common/MentionEditor/suggestion.js +0 -124
- package/src/components/index.js +0 -53
- package/src/stories/Accordion.stories.js +0 -151
- package/src/stories/AccordionModern.stories.js +0 -263
- package/src/stories/Alert.stories.js +0 -103
- package/src/stories/Avatar.stories.js +0 -79
- package/src/stories/Badge.stories.js +0 -112
- package/src/stories/BottomSheet.stories.js +0 -224
- package/src/stories/Breadcrumbs.stories.js +0 -143
- package/src/stories/Button.stories.js +0 -190
- package/src/stories/ButtonGroup.stories.js +0 -123
- package/src/stories/Card.stories.js +0 -73
- package/src/stories/Changelog.mdx +0 -1006
- package/src/stories/Chart.stories.js +0 -2017
- package/src/stories/ChatBot.stories.js +0 -668
- package/src/stories/Checkbox.stories.js +0 -209
- package/src/stories/Chips.stories.js +0 -106
- package/src/stories/CreateItemFlow.stories.js +0 -255
- package/src/stories/DatePicker.stories.js +0 -311
- package/src/stories/DateRangePicker.stories.js +0 -364
- package/src/stories/EmptyState.stories.js +0 -110
- package/src/stories/FileUpload.stories.js +0 -169
- package/src/stories/FilterPanel.stories.js +0 -309
- package/src/stories/FiltersStrip.stories.js +0 -244
- package/src/stories/GettingStarted.mdx +0 -153
- package/src/stories/Header.stories.js +0 -185
- package/src/stories/HomePage.stories.js +0 -201
- package/src/stories/Input.stories.js +0 -165
- package/src/stories/Loader.stories.js +0 -33
- package/src/stories/Menu.stories.js +0 -309
- package/src/stories/Modal.stories.js +0 -185
- package/src/stories/MonthPicker.stories.js +0 -313
- package/src/stories/MonthRangePicker.stories.js +0 -255
- package/src/stories/Notification.stories.js +0 -500
- package/src/stories/Panel.stories.js +0 -179
- package/src/stories/Popover.stories.js +0 -125
- package/src/stories/ProgressBar.stories.js +0 -93
- package/src/stories/Prompt.stories.js +0 -120
- package/src/stories/RadioButtonGroup.stories.js +0 -83
- package/src/stories/Select.stories.js +0 -753
- package/src/stories/Sidebar.stories.js +0 -177
- package/src/stories/Slider.stories.js +0 -226
- package/src/stories/Stepper.stories.js +0 -158
- package/src/stories/Switch.stories.js +0 -72
- package/src/stories/Table.stories.js +0 -4323
- package/src/stories/TableChat.mdx +0 -992
- package/src/stories/TableChat.stories.js +0 -1712
- package/src/stories/TableOld.stories.js +0 -954
- package/src/stories/Tabs.stories.js +0 -253
- package/src/stories/Tag.stories.js +0 -92
- package/src/stories/TagGroup.stories.js +0 -39
- package/src/stories/TextArea.stories.js +0 -148
- package/src/stories/Toast.stories.js +0 -113
- package/src/stories/Tooltip.stories.js +0 -86
- package/src/stories/storybookLinks.mdx +0 -20
|
@@ -1,832 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useMemo, useCallback } from "react";
|
|
2
|
-
import { Panel } from "../Panel";
|
|
3
|
-
import { PinnedPanel } from "./components/TableChatRightSection/PinedChatPanel/PinedChatPanel";
|
|
4
|
-
import "./TableChatSidePanel.styles.scss";
|
|
5
|
-
import TableChatRightSection from "./components/TableChatRightSection/TableChatRightSection";
|
|
6
|
-
import TableChatChannelHeader from "./components/TableChatLeftSection/TableChatChannelHeader";
|
|
7
|
-
import { Toast as ToastComponent } from "../Toast";
|
|
8
|
-
import { Prompt } from "../Prompt";
|
|
9
|
-
import ChatSkeleton from "./components/ChatMessageSkeleton/ChatSkeleton";
|
|
10
|
-
import ChatMessageListSkeleton from "./components/ChatMessageSkeleton/ChatMessageListSkeleton";
|
|
11
|
-
import { EmptyContainer } from "./EmptyContainer";
|
|
12
|
-
|
|
13
|
-
const defaultChatConfiguration = {
|
|
14
|
-
title: "Chat Feature",
|
|
15
|
-
description: "Chat with the team",
|
|
16
|
-
buttonLabel: "Chat",
|
|
17
|
-
buttonIcon: "chat",
|
|
18
|
-
buttonIconPosition: "left",
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const TableChatSidePanel = ({ isOpen, handleClose, chatConfiguration }) => {
|
|
22
|
-
const [selectedChannelId, setSelectedChannelId] = useState(null);
|
|
23
|
-
const [selectedChannelInfo, setSelectedChannelInfo] = useState(null);
|
|
24
|
-
const [selectedChatId, setSelectedChatId] = useState(null);
|
|
25
|
-
const [selectedChatInfo, setSelectedChatInfo] = useState(null);
|
|
26
|
-
|
|
27
|
-
const [isChatOpen, setIsChatOpen] = useState(false);
|
|
28
|
-
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
29
|
-
const [isMoreOpen, setIsMoreOpen] = useState(false);
|
|
30
|
-
const [pinnedMsg, setShowPinnedMsg] = useState(false);
|
|
31
|
-
const [showThread, setShowThread] = useState(false);
|
|
32
|
-
const [channelsList, setChannelsList] = useState([]);
|
|
33
|
-
const [chatList, setChatList] = useState([]);
|
|
34
|
-
const [loadingChannelsOrChats, setLoadingChannelsOrChats] = useState(true);
|
|
35
|
-
const [loadingMessages, setLoadingMessages] = useState(false); // right panel messages
|
|
36
|
-
const [originalChatList, setOriginalChatList] = useState([]);
|
|
37
|
-
const [originalChannelList, setOriginalChanelList] = useState([]);
|
|
38
|
-
const [pinnedMessages, setPinnedMessages] = useState([]);
|
|
39
|
-
const [loadingPinned, setLoadingPinned] = useState(false);
|
|
40
|
-
const [threadMessages, setThreadMessages] = useState([]);
|
|
41
|
-
const [loadingThread, setLoadingThread] = useState(false);
|
|
42
|
-
const [openToast, setOpenToast] = useState(false);
|
|
43
|
-
const [toastMessage, setToastMessage] = useState("");
|
|
44
|
-
const [toastVariant, setToastVariant] = useState("info");
|
|
45
|
-
const [selectedChat, setSelectedChat] = useState([]);
|
|
46
|
-
const [showDeletePrompt, setShowDeletePrompt] = useState(false);
|
|
47
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
48
|
-
const [isCreateNewChatOpen, setIsCreateNewChatOpen] = useState(false);
|
|
49
|
-
const [currentSelectedScreen, setCurrentSelectedScreen] =
|
|
50
|
-
useState("channels");
|
|
51
|
-
const [highlightMessageId, setHighlightMessageId] = useState(null); // For highlighting pinned messages
|
|
52
|
-
const [highlightTrigger, setHighlightTrigger] = useState(0); // Counter to force re-highlight
|
|
53
|
-
const isChannelsScreen = currentSelectedScreen === "channels";
|
|
54
|
-
const selectedChannelOrChatId = isChannelsScreen
|
|
55
|
-
? selectedChannelId
|
|
56
|
-
: selectedChatId;
|
|
57
|
-
|
|
58
|
-
// Extract real-time props from chatConfiguration.messageChatConfig
|
|
59
|
-
const realTimeMessages =
|
|
60
|
-
chatConfiguration?.messageChatConfig?.realTimeMessages || [];
|
|
61
|
-
const isWebSocketConnected =
|
|
62
|
-
chatConfiguration?.messageChatConfig?.isWebSocketConnected || false;
|
|
63
|
-
const currentTopicId =
|
|
64
|
-
chatConfiguration?.messageChatConfig?.currentTopicId || null;
|
|
65
|
-
const onRealTimeMessageUpdate =
|
|
66
|
-
chatConfiguration?.messageChatConfig?.onRealTimeMessageUpdate || null;
|
|
67
|
-
const currentUserId =
|
|
68
|
-
chatConfiguration?.messageChatConfig?.currentUserId || null;
|
|
69
|
-
|
|
70
|
-
const handleThreadClick = useCallback(
|
|
71
|
-
async (messageId) => {
|
|
72
|
-
setLoadingThread(true);
|
|
73
|
-
setShowThread(true);
|
|
74
|
-
|
|
75
|
-
try {
|
|
76
|
-
const data =
|
|
77
|
-
await chatConfiguration?.messageChatConfig?.loadThreadMessages(
|
|
78
|
-
messageId
|
|
79
|
-
);
|
|
80
|
-
setThreadMessages(data);
|
|
81
|
-
} catch (err) {
|
|
82
|
-
console.error("Error loading thread messages:", err);
|
|
83
|
-
} finally {
|
|
84
|
-
setLoadingThread(false);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
[chatConfiguration?.messageChatConfig?.loadThreadMessages]
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const handlePinMessage = useCallback(
|
|
91
|
-
async (messageId, isPinned, chatId, item) => {
|
|
92
|
-
try {
|
|
93
|
-
const response =
|
|
94
|
-
await chatConfiguration?.messageChatConfig?.onMessagePin(
|
|
95
|
-
messageId,
|
|
96
|
-
isPinned,
|
|
97
|
-
chatId,
|
|
98
|
-
item
|
|
99
|
-
);
|
|
100
|
-
// if exist I need to remove the message from the pinned messages
|
|
101
|
-
// If not exist I need to add the message to the pinned messages
|
|
102
|
-
if (pinnedMessages.some((message) => message.id === messageId)) {
|
|
103
|
-
const filteredPinnedMessages = pinnedMessages.filter(
|
|
104
|
-
(message) => message.id !== messageId
|
|
105
|
-
);
|
|
106
|
-
setPinnedMessages((prev) => [...filteredPinnedMessages]);
|
|
107
|
-
} else {
|
|
108
|
-
setPinnedMessages((prev) => [...prev, { ...response }]);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return response;
|
|
112
|
-
} catch (err) {
|
|
113
|
-
console.error("Error while pinning:", err);
|
|
114
|
-
} finally {
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
[chatConfiguration?.messageChatConfig?.onMessagePin, pinnedMessages]
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// Memoize messageConfig to prevent unnecessary re-renders
|
|
121
|
-
const memoizedMessageConfig = useMemo(
|
|
122
|
-
() => ({
|
|
123
|
-
...(chatConfiguration?.messageChatConfig || {}),
|
|
124
|
-
// Real-time message props
|
|
125
|
-
realTimeMessages,
|
|
126
|
-
isWebSocketConnected,
|
|
127
|
-
currentTopicId,
|
|
128
|
-
onRealTimeMessageUpdate,
|
|
129
|
-
currentUserId,
|
|
130
|
-
// Message loading
|
|
131
|
-
loadMessages: chatConfiguration?.rightPanel?.loadMessages,
|
|
132
|
-
// Message cleared trigger
|
|
133
|
-
messagesClearedTrigger:
|
|
134
|
-
chatConfiguration?.rightPanel?.messagesClearedTrigger,
|
|
135
|
-
// Selected message ID for highlighting and scrolling
|
|
136
|
-
// Prioritize dynamic highlightMessageId from pinned click over config
|
|
137
|
-
selectedMessageId:
|
|
138
|
-
highlightMessageId ||
|
|
139
|
-
chatConfiguration?.messageChatConfig?.selectedMessageId,
|
|
140
|
-
// Trigger for pinned message re-highlighting (increment to force re-highlight)
|
|
141
|
-
highlightTrigger: highlightMessageId ? highlightTrigger : null, // Only pass trigger for pinned messages
|
|
142
|
-
// Highlight configuration options
|
|
143
|
-
maxSearchPages: chatConfiguration?.messageChatConfig?.maxSearchPages,
|
|
144
|
-
highlightDuration:
|
|
145
|
-
chatConfiguration?.messageChatConfig?.highlightDuration,
|
|
146
|
-
scrollBehavior: chatConfiguration?.messageChatConfig?.scrollBehavior,
|
|
147
|
-
scrollBlock: chatConfiguration?.messageChatConfig?.scrollBlock,
|
|
148
|
-
highlightColor: chatConfiguration?.messageChatConfig?.highlightColor,
|
|
149
|
-
// Message action handlers
|
|
150
|
-
onMessagePin: handlePinMessage,
|
|
151
|
-
onClearAllMessages:
|
|
152
|
-
chatConfiguration?.messageChatConfig?.onClearAllMessages,
|
|
153
|
-
onThreadClick: (messageId, messageItem) => {
|
|
154
|
-
setShowPinnedMsg(false);
|
|
155
|
-
setShowThread(true);
|
|
156
|
-
handleThreadClick();
|
|
157
|
-
chatConfiguration?.messageChatConfig?.onThreadClick?.(
|
|
158
|
-
messageId,
|
|
159
|
-
messageItem
|
|
160
|
-
);
|
|
161
|
-
},
|
|
162
|
-
// Load participants for mentions
|
|
163
|
-
loadParticipantsAvatar:
|
|
164
|
-
chatConfiguration?.headerChatConfig?.loadParticipantsAvatar,
|
|
165
|
-
}),
|
|
166
|
-
[
|
|
167
|
-
chatConfiguration?.messageChatConfig,
|
|
168
|
-
realTimeMessages,
|
|
169
|
-
isWebSocketConnected,
|
|
170
|
-
currentTopicId,
|
|
171
|
-
onRealTimeMessageUpdate,
|
|
172
|
-
currentUserId,
|
|
173
|
-
chatConfiguration?.rightPanel?.loadMessages,
|
|
174
|
-
chatConfiguration?.rightPanel?.messagesClearedTrigger,
|
|
175
|
-
highlightMessageId, // Dynamic highlight from pinned message click
|
|
176
|
-
highlightTrigger, // Trigger to force re-highlight
|
|
177
|
-
chatConfiguration?.messageChatConfig?.selectedMessageId,
|
|
178
|
-
chatConfiguration?.messageChatConfig?.maxSearchPages,
|
|
179
|
-
chatConfiguration?.messageChatConfig?.highlightDuration,
|
|
180
|
-
chatConfiguration?.messageChatConfig?.scrollBehavior,
|
|
181
|
-
chatConfiguration?.messageChatConfig?.scrollBlock,
|
|
182
|
-
chatConfiguration?.messageChatConfig?.highlightColor,
|
|
183
|
-
handlePinMessage,
|
|
184
|
-
handleThreadClick,
|
|
185
|
-
chatConfiguration?.messageChatConfig?.onThreadClick,
|
|
186
|
-
chatConfiguration?.headerChatConfig?.loadParticipantsAvatar,
|
|
187
|
-
]
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
const handleToast = (isOpen, message = "", variant = "info") => {
|
|
191
|
-
if (isOpen) {
|
|
192
|
-
setOpenToast(isOpen);
|
|
193
|
-
setToastMessage(message);
|
|
194
|
-
setToastVariant(variant);
|
|
195
|
-
} else {
|
|
196
|
-
setOpenToast(false);
|
|
197
|
-
setToastMessage("");
|
|
198
|
-
setToastVariant("info");
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// Once user click on a chat, then we will set the selected chat id and info
|
|
203
|
-
const handleChatClick = async (chatId, selectedChatData) => {
|
|
204
|
-
setCurrentSelectedScreen("chats");
|
|
205
|
-
setLoadingMessages(true); // 👈 show skeleton
|
|
206
|
-
setSelectedChatId(chatId);
|
|
207
|
-
setSelectedChatInfo(selectedChatData);
|
|
208
|
-
setHighlightMessageId(null); // Reset highlight when switching chats
|
|
209
|
-
try {
|
|
210
|
-
if (chatConfiguration?.headerChatConfig?.onChatClick) {
|
|
211
|
-
await chatConfiguration.headerChatConfig.onChatClick(
|
|
212
|
-
chatId,
|
|
213
|
-
selectedChannelId
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
// Messages will be loaded directly in TableChatRightSection
|
|
217
|
-
} catch (err) {
|
|
218
|
-
console.error("[TableChatSidePanel] [handleChatClick] [error]:", err);
|
|
219
|
-
handleToast(true, "Error loading chat", "error");
|
|
220
|
-
} finally {
|
|
221
|
-
setLoadingMessages(false); // 👈 hide skeleton
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const fetchChatList = async (currentActiveChannelInfo) => {
|
|
226
|
-
setCurrentSelectedScreen("chats");
|
|
227
|
-
setSelectedChat([]); // Clear selected chats when switching channels
|
|
228
|
-
if (chatConfiguration?.leftPanel?.loadChatList) {
|
|
229
|
-
setLoadingChannelsOrChats(true);
|
|
230
|
-
try {
|
|
231
|
-
const chatList = await chatConfiguration.leftPanel.loadChatList(
|
|
232
|
-
currentActiveChannelInfo
|
|
233
|
-
);
|
|
234
|
-
setChatList(chatList);
|
|
235
|
-
setOriginalChatList(chatList);
|
|
236
|
-
return chatList;
|
|
237
|
-
} catch (err) {
|
|
238
|
-
console.error("[TableChatSidePanel] [fetchChatList] [error]:", err);
|
|
239
|
-
handleToast(true, "Error while loading chats", "error");
|
|
240
|
-
} finally {
|
|
241
|
-
setLoadingChannelsOrChats(false);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const handleChatName = async (formData, selectedChannelId) => {
|
|
247
|
-
try {
|
|
248
|
-
// Call the original handleChatName function
|
|
249
|
-
const response = await chatConfiguration?.leftPanel?.handleChatName?.(
|
|
250
|
-
formData,
|
|
251
|
-
selectedChannelId
|
|
252
|
-
);
|
|
253
|
-
// If successful, refresh the chat list and auto-select the new chat
|
|
254
|
-
if (response?.success) {
|
|
255
|
-
setIsCreateNewChatOpen(false);
|
|
256
|
-
// Auto-select and open the newly created chat
|
|
257
|
-
if (response?.formattedChat) {
|
|
258
|
-
const newChat = response.formattedChat;
|
|
259
|
-
const newChannelInfo = {
|
|
260
|
-
id: newChat?.otherProps?.object_ids?.[0],
|
|
261
|
-
title: "Chat List",
|
|
262
|
-
objectType: newChat?.otherProps?.object_type, // or get from configuration
|
|
263
|
-
};
|
|
264
|
-
await fetchChatList(newChannelInfo);
|
|
265
|
-
// If user direclty coming from create new chat panel, then set the selected channel info and id (both will null on that time)
|
|
266
|
-
setSelectedChannelInfo(newChannelInfo);
|
|
267
|
-
setSelectedChannelId(newChat?.otherProps?.object_ids?.[0]);
|
|
268
|
-
// Then I want newly created chat to be selected
|
|
269
|
-
await handleChatClick(newChat.id, newChat);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return response;
|
|
274
|
-
} catch (error) {
|
|
275
|
-
console.error("[TableChatSidePanel] [handleChatName] [error]:", error);
|
|
276
|
-
throw error;
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
// Fetch the channel list
|
|
281
|
-
const fetchChannelList = async () => {
|
|
282
|
-
setCurrentSelectedScreen("channels");
|
|
283
|
-
setLoadingChannelsOrChats(true);
|
|
284
|
-
try {
|
|
285
|
-
const channelList = await chatConfiguration.leftPanel.loadChannelsList();
|
|
286
|
-
setChannelsList(channelList);
|
|
287
|
-
setOriginalChanelList(channelList);
|
|
288
|
-
} catch (error) {
|
|
289
|
-
console.error("[TableChatSidePanel] [fetchChannelList] [error]:", error);
|
|
290
|
-
handleToast(true, "Error while loading channels", "error");
|
|
291
|
-
} finally {
|
|
292
|
-
setLoadingChannelsOrChats(false);
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const fetchChannelsOrChats = async () => {
|
|
297
|
-
setLoadingChannelsOrChats(true);
|
|
298
|
-
try {
|
|
299
|
-
// Once user click on a chat icon in the table , then we will set the selected chat id and info
|
|
300
|
-
if (
|
|
301
|
-
chatConfiguration?.leftPanel?.hasDirectChatList &&
|
|
302
|
-
chatConfiguration?.leftPanel?.directChatList?.length > 0
|
|
303
|
-
) {
|
|
304
|
-
// Set the current selected screen to chats (Opening chat panel) not the channels panel
|
|
305
|
-
setCurrentSelectedScreen("chats");
|
|
306
|
-
// Set up for direct chat list display(directChatList=all chats list related to the channel)
|
|
307
|
-
const directChatList = chatConfiguration.leftPanel.directChatList;
|
|
308
|
-
// Set the chat list and original chat list
|
|
309
|
-
setChatList(directChatList);
|
|
310
|
-
setOriginalChatList(directChatList);
|
|
311
|
-
// Create a fake channel info for the direct chat list
|
|
312
|
-
const channelInfo = {
|
|
313
|
-
id: directChatList?.[0]?.otherProps?.object_ids?.[0],
|
|
314
|
-
title: "Chat List",
|
|
315
|
-
objectType: directChatList?.[0]?.otherProps?.object_type, // or get from configuration
|
|
316
|
-
};
|
|
317
|
-
// Set the selected channel id and info
|
|
318
|
-
setSelectedChannelId(directChatList?.[0]?.otherProps?.object_ids?.[0]);
|
|
319
|
-
setSelectedChannelInfo(channelInfo);
|
|
320
|
-
|
|
321
|
-
// Automatically open a specific chat or the first chat (index 0)
|
|
322
|
-
if (directChatList.length > 0) {
|
|
323
|
-
// Check if a specific chatId is provided in configuration
|
|
324
|
-
const selectedChatId = chatConfiguration?.leftPanel?.selectedChatId;
|
|
325
|
-
|
|
326
|
-
let chatToSelect;
|
|
327
|
-
if (selectedChatId) {
|
|
328
|
-
// Find the specific chat by ID
|
|
329
|
-
chatToSelect = directChatList.find(
|
|
330
|
-
(chat) => chat.id === selectedChatId
|
|
331
|
-
);
|
|
332
|
-
// If specific chat not found, fall back to first chat
|
|
333
|
-
if (!chatToSelect) {
|
|
334
|
-
chatToSelect = directChatList?.[0];
|
|
335
|
-
}
|
|
336
|
-
} else {
|
|
337
|
-
// No specific chat ID provided, select first chat
|
|
338
|
-
chatToSelect = directChatList?.[0];
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Select the determined chat
|
|
342
|
-
await handleChatClick(chatToSelect?.id, chatToSelect);
|
|
343
|
-
}
|
|
344
|
-
} else if (
|
|
345
|
-
chatConfiguration?.leftPanel?.hasDirectChatList &&
|
|
346
|
-
chatConfiguration?.leftPanel?.directChatList?.length === 0
|
|
347
|
-
) {
|
|
348
|
-
// Set the current selected screen to chats (Opening chat panel) not the channels panel
|
|
349
|
-
setCurrentSelectedScreen("chats");
|
|
350
|
-
// This is open create new chat panel
|
|
351
|
-
setIsCreateNewChatOpen(true);
|
|
352
|
-
} else {
|
|
353
|
-
// Normal channel loading flow (if user directly coming by clicking on global general chat icon)
|
|
354
|
-
await fetchChannelList();
|
|
355
|
-
}
|
|
356
|
-
} catch (error) {
|
|
357
|
-
console.error("[TableChatSidePanel] [fetchChannels] [error]:", error);
|
|
358
|
-
handleToast(true, "Error while loading channels list", "error");
|
|
359
|
-
} finally {
|
|
360
|
-
setLoadingChannelsOrChats(false);
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
const clearnupLocalStates = () => {
|
|
365
|
-
setSelectedChannelId(null);
|
|
366
|
-
setSelectedChannelInfo(null);
|
|
367
|
-
setSelectedChatInfo(null);
|
|
368
|
-
setSelectedChatId(null);
|
|
369
|
-
setChatList([]);
|
|
370
|
-
setOriginalChatList([]);
|
|
371
|
-
setSelectedChat([]);
|
|
372
|
-
setShowPinnedMsg(false);
|
|
373
|
-
setShowThread(false);
|
|
374
|
-
setPinnedMessages([]);
|
|
375
|
-
setThreadMessages([]);
|
|
376
|
-
setIsSearchOpen(false);
|
|
377
|
-
setIsMoreOpen(false);
|
|
378
|
-
setHighlightMessageId(null); // Reset highlight when cleaning up
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
// Handle back button click - clear direct chat and load channels
|
|
382
|
-
const handleBackToChannels = async () => {
|
|
383
|
-
// Clear direct chat list in parent component
|
|
384
|
-
if (chatConfiguration?.leftPanel?.clearDirectChatList) {
|
|
385
|
-
chatConfiguration.leftPanel.clearDirectChatList();
|
|
386
|
-
}
|
|
387
|
-
// Reset states
|
|
388
|
-
clearnupLocalStates();
|
|
389
|
-
// Fetch the channel list when user click on back button
|
|
390
|
-
await fetchChannelList();
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
// Once chat side panel is open, then fetch the channels or chats
|
|
394
|
-
useEffect(() => {
|
|
395
|
-
if (isOpen) {
|
|
396
|
-
fetchChannelsOrChats();
|
|
397
|
-
}
|
|
398
|
-
}, [isOpen]);
|
|
399
|
-
|
|
400
|
-
// Once chat side panel is closed, then reset all states
|
|
401
|
-
useEffect(() => {
|
|
402
|
-
if (!isOpen) {
|
|
403
|
-
// Reset all states when panel is closed
|
|
404
|
-
clearnupLocalStates();
|
|
405
|
-
|
|
406
|
-
// Clear direct chat list in the parent component
|
|
407
|
-
if (chatConfiguration?.leftPanel?.clearDirectChatList) {
|
|
408
|
-
chatConfiguration.leftPanel.clearDirectChatList();
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}, [isOpen]); // Remove clearDirectChatList from dependencies to prevent infinite loop
|
|
412
|
-
|
|
413
|
-
// Clear highlightMessageId after highlight duration to prevent re-highlighting on new messages
|
|
414
|
-
useEffect(() => {
|
|
415
|
-
if (highlightMessageId) {
|
|
416
|
-
// Get highlight duration from config or use default (3000ms = 3 seconds)
|
|
417
|
-
const highlightDuration =
|
|
418
|
-
chatConfiguration?.messageChatConfig?.highlightDuration || 3000;
|
|
419
|
-
|
|
420
|
-
// Set timeout to clear highlight after animation completes
|
|
421
|
-
const timeoutId = setTimeout(() => {
|
|
422
|
-
setHighlightMessageId(null);
|
|
423
|
-
}, highlightDuration);
|
|
424
|
-
|
|
425
|
-
// Cleanup timeout if highlightMessageId changes or component unmounts
|
|
426
|
-
return () => {
|
|
427
|
-
clearTimeout(timeoutId);
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
}, [
|
|
431
|
-
highlightMessageId,
|
|
432
|
-
chatConfiguration?.messageChatConfig?.highlightDuration,
|
|
433
|
-
]);
|
|
434
|
-
|
|
435
|
-
// const openChat = () => setIsChatOpen(true);
|
|
436
|
-
const toggleMenu = () => setIsMoreOpen(!isMoreOpen);
|
|
437
|
-
const openSearch = () => setIsSearchOpen(!isSearchOpen);
|
|
438
|
-
const showMore = () => setIsMoreOpen(true);
|
|
439
|
-
|
|
440
|
-
const handlePinnedClick = async (chatId) => {
|
|
441
|
-
setLoadingPinned(true);
|
|
442
|
-
try {
|
|
443
|
-
const data = await chatConfiguration?.headerChatConfig?.onPinnedClick(
|
|
444
|
-
chatId
|
|
445
|
-
);
|
|
446
|
-
setPinnedMessages(data);
|
|
447
|
-
} catch (err) {
|
|
448
|
-
console.error("[TableChatSidePanel] [handlePinnedClick] [error]:", err);
|
|
449
|
-
} finally {
|
|
450
|
-
setLoadingPinned(false);
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
// Handle click on a pinned message to highlight it in main chat
|
|
455
|
-
const handlePinnedMessageClick = (messageId) => {
|
|
456
|
-
// Don't close the pinned panel - keep it open for reference
|
|
457
|
-
|
|
458
|
-
// Set the message ID to highlight
|
|
459
|
-
setHighlightMessageId(messageId);
|
|
460
|
-
|
|
461
|
-
// Increment trigger to force re-highlight even if same message clicked again
|
|
462
|
-
setHighlightTrigger((prev) => prev + 1);
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
const handleChannelClick = async (selectedChannelId, selectedChannelInfo) => {
|
|
466
|
-
setSelectedChannelId(selectedChannelId);
|
|
467
|
-
setSelectedChannelInfo(selectedChannelInfo);
|
|
468
|
-
const chatList = await fetchChatList(selectedChannelInfo); // Fetch the chat list when user click on a channel
|
|
469
|
-
// select the first chat
|
|
470
|
-
if (chatList && chatList.length > 0) {
|
|
471
|
-
const firstChat = chatList?.[0];
|
|
472
|
-
await handleChatClick(firstChat?.id, firstChat);
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
// Function to handle chat selection (for delete functionality)
|
|
477
|
-
const handleChatSelect = (selectedChatId) => {
|
|
478
|
-
setSelectedChat(
|
|
479
|
-
(prev) =>
|
|
480
|
-
prev.includes(selectedChatId)
|
|
481
|
-
? prev.filter((id) => id !== selectedChatId) // remove
|
|
482
|
-
: [...prev, selectedChatId] // add
|
|
483
|
-
);
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
const filterChannelsByTitle = useCallback(
|
|
487
|
-
(searchText) => {
|
|
488
|
-
const targetList = isChannelsScreen
|
|
489
|
-
? originalChannelList
|
|
490
|
-
: originalChatList;
|
|
491
|
-
if (!searchText) {
|
|
492
|
-
// reset original lists
|
|
493
|
-
if (isChannelsScreen) {
|
|
494
|
-
setChannelsList(originalChannelList);
|
|
495
|
-
} else {
|
|
496
|
-
setChatList(originalChatList);
|
|
497
|
-
}
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
const filtered =
|
|
502
|
-
targetList?.filter((ch) =>
|
|
503
|
-
ch.title.toLowerCase().includes(searchText.toLowerCase())
|
|
504
|
-
) || [];
|
|
505
|
-
|
|
506
|
-
if (isChannelsScreen) {
|
|
507
|
-
// Ensure we're creating a new array reference
|
|
508
|
-
setChannelsList([...filtered]);
|
|
509
|
-
} else {
|
|
510
|
-
setChatList([...filtered]);
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
[isChannelsScreen, originalChannelList, originalChatList]
|
|
514
|
-
);
|
|
515
|
-
|
|
516
|
-
// Handle opening delete prompt
|
|
517
|
-
const handleDeletePromptOpen = () => {
|
|
518
|
-
if (!selectedChat || selectedChat.length === 0) {
|
|
519
|
-
handleToast(true, "No chats selected for deletion", "error");
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
setShowDeletePrompt(true);
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
// Handle the actual deletion process
|
|
526
|
-
const handleDeleteChat = async () => {
|
|
527
|
-
if (!selectedChat || selectedChat.length === 0) {
|
|
528
|
-
handleToast(true, "No chats selected for deletion", "error");
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
try {
|
|
533
|
-
// Show loading state
|
|
534
|
-
setIsDeleting(true);
|
|
535
|
-
// setLoadingChannelsOrChats(true);
|
|
536
|
-
|
|
537
|
-
// Check if any of the deleted topics is currently active
|
|
538
|
-
const isActiveTopicDeleted = selectedChat.includes(selectedChatId);
|
|
539
|
-
|
|
540
|
-
// Delete all selected topics using Promise.all
|
|
541
|
-
const deletePromises = selectedChat.map((topicId) =>
|
|
542
|
-
chatConfiguration?.leftPanel?.deleteChat?.(topicId)
|
|
543
|
-
);
|
|
544
|
-
|
|
545
|
-
await Promise.all(deletePromises);
|
|
546
|
-
setShowDeletePrompt(false);
|
|
547
|
-
setIsDeleting(false);
|
|
548
|
-
|
|
549
|
-
// Close the prompt after successful deletion
|
|
550
|
-
|
|
551
|
-
// Clear selected chats after successful deletion
|
|
552
|
-
setSelectedChat([]);
|
|
553
|
-
|
|
554
|
-
// Mark all deleted topics as deleted to prevent reconnection
|
|
555
|
-
if (chatConfiguration?.messageChatConfig?.markTopicAsDeleted) {
|
|
556
|
-
selectedChat.forEach((topicId) => {
|
|
557
|
-
chatConfiguration?.messageChatConfig?.markTopicAsDeleted(topicId);
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
// If active topic was deleted, handle cleanup
|
|
562
|
-
if (isActiveTopicDeleted) {
|
|
563
|
-
// 1. Disconnect WebSocket for the deleted topic
|
|
564
|
-
if (chatConfiguration?.messageChatConfig?.leaveCurrentTopic) {
|
|
565
|
-
chatConfiguration?.messageChatConfig?.leaveCurrentTopic();
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
// 2. Reset message list to ideal state
|
|
569
|
-
setPinnedMessages([]);
|
|
570
|
-
setThreadMessages([]);
|
|
571
|
-
// 3. Clear selected chat info (no chat selected state)
|
|
572
|
-
setSelectedChatInfo(null);
|
|
573
|
-
setSelectedChatId(null);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// Refresh chat list after successful deletion
|
|
577
|
-
if (selectedChannelInfo) {
|
|
578
|
-
const updatedChatList = await fetchChatList(selectedChannelInfo);
|
|
579
|
-
|
|
580
|
-
// If active topic was deleted and there are remaining chats, auto-select the first one
|
|
581
|
-
if (
|
|
582
|
-
isActiveTopicDeleted &&
|
|
583
|
-
updatedChatList &&
|
|
584
|
-
updatedChatList.length > 0
|
|
585
|
-
) {
|
|
586
|
-
const firstChat = updatedChatList?.[0];
|
|
587
|
-
await handleChatClick(firstChat.id, firstChat);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
} catch (error) {
|
|
591
|
-
console.error("[TableChatSidePanel] [handleDeleteChat] [error]:", error);
|
|
592
|
-
handleToast(true, "Error deleting topics", "error");
|
|
593
|
-
|
|
594
|
-
// Keep prompt open on error so user can retry or cancel
|
|
595
|
-
} finally {
|
|
596
|
-
setIsDeleting(false);
|
|
597
|
-
setLoadingChannelsOrChats(false);
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
return (
|
|
602
|
-
<aside id="table-chat-side-panel">
|
|
603
|
-
<Panel
|
|
604
|
-
anchor="right"
|
|
605
|
-
className={"table-chat-panel"}
|
|
606
|
-
open={isOpen}
|
|
607
|
-
onClose={handleClose}
|
|
608
|
-
title={chatConfiguration?.title}
|
|
609
|
-
size="medium"
|
|
610
|
-
setIsOpen={() => setIsChatOpen(!isChatOpen)}
|
|
611
|
-
width={pinnedMsg || showThread ? 1450 : 985}
|
|
612
|
-
>
|
|
613
|
-
<div className="table-chat-container">
|
|
614
|
-
<TableChatChannelHeader
|
|
615
|
-
title={
|
|
616
|
-
isChannelsScreen ? "Channels List" : selectedChannelInfo?.title
|
|
617
|
-
}
|
|
618
|
-
channels={isChannelsScreen ? channelsList : chatList}
|
|
619
|
-
selectedChannelOrChatId={selectedChannelOrChatId}
|
|
620
|
-
onBack={handleBackToChannels} // 👈 back click => load channels with loader
|
|
621
|
-
onChannelSelect={(id, selectedChannelOrChat) => {
|
|
622
|
-
if (isChannelsScreen) {
|
|
623
|
-
handleChannelClick(id, selectedChannelOrChat);
|
|
624
|
-
} else {
|
|
625
|
-
// for chat render
|
|
626
|
-
handleChatClick(id, selectedChannelOrChat);
|
|
627
|
-
}
|
|
628
|
-
}}
|
|
629
|
-
showChannelList={isChannelsScreen}
|
|
630
|
-
onMenuClick={toggleMenu}
|
|
631
|
-
onSearchClick={openSearch}
|
|
632
|
-
onMoreClick={showMore}
|
|
633
|
-
isSearchOpen={isSearchOpen}
|
|
634
|
-
headerConfig={chatConfiguration?.leftPanel?.leftHeaderPanel}
|
|
635
|
-
showAddChatBtn={
|
|
636
|
-
chatConfiguration?.leftPanel?.leftHeaderPanel?.showAddChat
|
|
637
|
-
}
|
|
638
|
-
showCheckbox={
|
|
639
|
-
chatConfiguration?.leftPanel?.leftChatPanel?.showCheckbox
|
|
640
|
-
}
|
|
641
|
-
handleChatName={handleChatName}
|
|
642
|
-
onPinnedChatClick={
|
|
643
|
-
chatConfiguration?.headerChatConfig?.onPinnedChatClick
|
|
644
|
-
}
|
|
645
|
-
filterChannelsByTitle={filterChannelsByTitle}
|
|
646
|
-
loadingChannels={loadingChannelsOrChats}
|
|
647
|
-
handleToast={handleToast}
|
|
648
|
-
selectedChannelInfo={selectedChannelInfo}
|
|
649
|
-
onDeleteTopics={handleDeletePromptOpen}
|
|
650
|
-
selectedChat={selectedChat}
|
|
651
|
-
handleChatSelect={handleChatSelect}
|
|
652
|
-
isCreateNewChatOpen={isCreateNewChatOpen}
|
|
653
|
-
setIsCreateNewChatOpen={setIsCreateNewChatOpen}
|
|
654
|
-
/>
|
|
655
|
-
|
|
656
|
-
{/*Right section starts here */}
|
|
657
|
-
{loadingMessages ? (
|
|
658
|
-
<ChatSkeleton text="Loading messages..." />
|
|
659
|
-
) : (
|
|
660
|
-
<>
|
|
661
|
-
{!selectedChannelId || !selectedChatId ? (
|
|
662
|
-
<EmptyContainer
|
|
663
|
-
title={
|
|
664
|
-
!selectedChannelId
|
|
665
|
-
? chatConfiguration?.messageChatConfig
|
|
666
|
-
?.emptyChannelStateTitle
|
|
667
|
-
: !selectedChatId
|
|
668
|
-
? chatConfiguration?.messageChatConfig
|
|
669
|
-
?.emptyChatStateTitle
|
|
670
|
-
: ""
|
|
671
|
-
}
|
|
672
|
-
subTitle={
|
|
673
|
-
!selectedChannelId
|
|
674
|
-
? chatConfiguration?.messageChatConfig
|
|
675
|
-
?.emptyChannelStateSubTitle
|
|
676
|
-
: !selectedChatId
|
|
677
|
-
? chatConfiguration?.messageChatConfig
|
|
678
|
-
?.emptyChatStateSubTitle
|
|
679
|
-
: ""
|
|
680
|
-
}
|
|
681
|
-
/>
|
|
682
|
-
) : (
|
|
683
|
-
<TableChatRightSection
|
|
684
|
-
// Basic props
|
|
685
|
-
chatId={selectedChatId}
|
|
686
|
-
title={selectedChatInfo?.title}
|
|
687
|
-
CreatedBy={
|
|
688
|
-
selectedChatInfo?.otherProps?.created_by_user ??
|
|
689
|
-
selectedChatInfo?.createdBy ??
|
|
690
|
-
selectedChatInfo?.user ??
|
|
691
|
-
"—"
|
|
692
|
-
}
|
|
693
|
-
createdAt={
|
|
694
|
-
selectedChatInfo?.timestamp ??
|
|
695
|
-
selectedChatInfo?.createdAt ??
|
|
696
|
-
(selectedChatInfo?.otherProps?.created_at
|
|
697
|
-
? new Date(
|
|
698
|
-
selectedChatInfo.otherProps.created_at
|
|
699
|
-
).toLocaleString(undefined, {
|
|
700
|
-
dateStyle: "medium",
|
|
701
|
-
timeStyle: "short",
|
|
702
|
-
})
|
|
703
|
-
: "")
|
|
704
|
-
}
|
|
705
|
-
// Header configuration
|
|
706
|
-
chatHeaderConfig={{
|
|
707
|
-
...chatConfiguration?.headerChatConfig,
|
|
708
|
-
onPinnedClick: (chatId) => {
|
|
709
|
-
setShowThread(false);
|
|
710
|
-
setShowPinnedMsg(true);
|
|
711
|
-
handlePinnedClick(chatId);
|
|
712
|
-
},
|
|
713
|
-
}}
|
|
714
|
-
messageConfig={memoizedMessageConfig}
|
|
715
|
-
showParticipantsList={
|
|
716
|
-
chatConfiguration?.leftPanel?.rightHeaderPanel
|
|
717
|
-
?.showParticipants
|
|
718
|
-
}
|
|
719
|
-
showPinnedChat={
|
|
720
|
-
chatConfiguration?.leftPanel?.rightHeaderPanel
|
|
721
|
-
?.showPinnedChat
|
|
722
|
-
}
|
|
723
|
-
showSearch={
|
|
724
|
-
chatConfiguration?.leftPanel?.rightHeaderPanel
|
|
725
|
-
?.showChatSearch
|
|
726
|
-
}
|
|
727
|
-
setPinnedMessages={setPinnedMessages}
|
|
728
|
-
showActionBtn={
|
|
729
|
-
chatConfiguration?.leftPanel?.rightHeaderPanel
|
|
730
|
-
?.showActionBtn
|
|
731
|
-
}
|
|
732
|
-
handleToast={handleToast}
|
|
733
|
-
inputChatConfig={{
|
|
734
|
-
...chatConfiguration.inputChatConfig,
|
|
735
|
-
}}
|
|
736
|
-
/>
|
|
737
|
-
)}
|
|
738
|
-
</>
|
|
739
|
-
)}
|
|
740
|
-
{loadingPinned ? (
|
|
741
|
-
<>
|
|
742
|
-
{/* List item skeletons */}
|
|
743
|
-
<ChatMessageListSkeleton
|
|
744
|
-
className="thread-skeleton"
|
|
745
|
-
messageCount={5}
|
|
746
|
-
/>
|
|
747
|
-
|
|
748
|
-
{/* Bottom action skeleton */}
|
|
749
|
-
</>
|
|
750
|
-
) : (
|
|
751
|
-
<>
|
|
752
|
-
{pinnedMsg && (
|
|
753
|
-
<PinnedPanel
|
|
754
|
-
messages={pinnedMessages}
|
|
755
|
-
onClose={() => setShowPinnedMsg(!pinnedMsg)}
|
|
756
|
-
handleToast={handleToast}
|
|
757
|
-
onMessageClick={handlePinnedMessageClick}
|
|
758
|
-
/>
|
|
759
|
-
)}
|
|
760
|
-
</>
|
|
761
|
-
)}
|
|
762
|
-
{loadingThread ? (
|
|
763
|
-
<>
|
|
764
|
-
{/* Header skeleton */}
|
|
765
|
-
|
|
766
|
-
{/* List item skeletons */}
|
|
767
|
-
{/* <SkeletonList text="Loading messages..." /> */}
|
|
768
|
-
<ChatMessageListSkeleton
|
|
769
|
-
className="thread-skeleton"
|
|
770
|
-
messageCount={5}
|
|
771
|
-
/>
|
|
772
|
-
|
|
773
|
-
{/* Bottom action skeleton */}
|
|
774
|
-
</>
|
|
775
|
-
) : (
|
|
776
|
-
<>
|
|
777
|
-
{showThread && (
|
|
778
|
-
<PinnedPanel
|
|
779
|
-
type="thread"
|
|
780
|
-
messages={threadMessages}
|
|
781
|
-
onClose={() => setShowThread(!showThread)}
|
|
782
|
-
handleToast={handleToast}
|
|
783
|
-
/>
|
|
784
|
-
)}
|
|
785
|
-
</>
|
|
786
|
-
)}
|
|
787
|
-
</div>
|
|
788
|
-
</Panel>
|
|
789
|
-
|
|
790
|
-
{/* Delete Confirmation Prompt */}
|
|
791
|
-
<Prompt
|
|
792
|
-
handleClose={() => {
|
|
793
|
-
if (!isDeleting) {
|
|
794
|
-
setShowDeletePrompt(false);
|
|
795
|
-
}
|
|
796
|
-
}}
|
|
797
|
-
isOpen={showDeletePrompt || isDeleting}
|
|
798
|
-
onPrimaryButtonClick={() => {
|
|
799
|
-
if (!isDeleting) {
|
|
800
|
-
handleDeleteChat();
|
|
801
|
-
}
|
|
802
|
-
}}
|
|
803
|
-
onSecondaryButtonClick={() => {
|
|
804
|
-
if (!isDeleting) {
|
|
805
|
-
setShowDeletePrompt(false);
|
|
806
|
-
}
|
|
807
|
-
}}
|
|
808
|
-
primaryButtonLabel={isDeleting ? "Deleting..." : "Delete"}
|
|
809
|
-
secondaryButtonLabel="Cancel"
|
|
810
|
-
title="Delete Chats"
|
|
811
|
-
variant="error"
|
|
812
|
-
primaryButtonProps={{
|
|
813
|
-
disabled: isDeleting,
|
|
814
|
-
loading: isDeleting,
|
|
815
|
-
}}
|
|
816
|
-
>
|
|
817
|
-
Are you sure you want to delete {selectedChat?.length} selected chat
|
|
818
|
-
{selectedChat?.length > 1 ? "s" : ""}? This action cannot be undone.
|
|
819
|
-
</Prompt>
|
|
820
|
-
|
|
821
|
-
<ToastComponent
|
|
822
|
-
isOpen={openToast}
|
|
823
|
-
message={toastMessage}
|
|
824
|
-
onClose={() => setOpenToast(!openToast)}
|
|
825
|
-
position="top-right"
|
|
826
|
-
variant={toastVariant}
|
|
827
|
-
/>
|
|
828
|
-
</aside>
|
|
829
|
-
);
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
export default TableChatSidePanel;
|