mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 09:46:25 +02:00
feat: implement chat archiving functionality in LayoutDataProvider
- Added the ability to archive and unarchive chat threads, enhancing user interaction with chat items. - Introduced a new `handleChatArchive` function to manage the archiving state and provide user feedback via toast notifications. - Updated the `ChatItem` type to include an `archived` property for tracking the archive status. - Modified relevant components to support the new archiving feature, including `ChatListItem`, `Sidebar`, and `MobileSidebar`.
This commit is contained in:
parent
7ccb52dc76
commit
a51fe2ee69
7 changed files with 81 additions and 14 deletions
|
|
@ -27,6 +27,7 @@ interface SidebarProps {
|
|||
onNewChat: () => void;
|
||||
onChatSelect: (chat: ChatItem) => void;
|
||||
onChatDelete?: (chat: ChatItem) => void;
|
||||
onChatArchive?: (chat: ChatItem) => void;
|
||||
onViewAllSharedChats?: () => void;
|
||||
onViewAllPrivateChats?: () => void;
|
||||
user: User;
|
||||
|
|
@ -52,6 +53,7 @@ export function Sidebar({
|
|||
onNewChat,
|
||||
onChatSelect,
|
||||
onChatDelete,
|
||||
onChatArchive,
|
||||
onViewAllSharedChats,
|
||||
onViewAllPrivateChats,
|
||||
user,
|
||||
|
|
@ -175,7 +177,9 @@ export function Sidebar({
|
|||
key={chat.id}
|
||||
name={chat.name}
|
||||
isActive={chat.id === activeChatId}
|
||||
archived={chat.archived}
|
||||
onClick={() => onChatSelect(chat)}
|
||||
onArchive={() => onChatArchive?.(chat)}
|
||||
onDelete={() => onChatDelete?.(chat)}
|
||||
/>
|
||||
))}
|
||||
|
|
@ -216,7 +220,9 @@ export function Sidebar({
|
|||
key={chat.id}
|
||||
name={chat.name}
|
||||
isActive={chat.id === activeChatId}
|
||||
archived={chat.archived}
|
||||
onClick={() => onChatSelect(chat)}
|
||||
onArchive={() => onChatArchive?.(chat)}
|
||||
onDelete={() => onChatDelete?.(chat)}
|
||||
/>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue