-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
93 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
import { ChatList } from '@lobehub/ui'; | ||
import isEqual from 'fast-deep-equal'; | ||
import { memo } from 'react'; | ||
import { shallow } from 'zustand/shallow'; | ||
|
||
import { chatSelectors, useChatStore } from '@/store/session'; | ||
|
||
const List = () => { | ||
const data = useChatStore(chatSelectors.currentChats, isEqual); | ||
const [deleteMessage, resendMessage] = useChatStore((s) => [s.deleteMessage, s.resendMessage], shallow); | ||
|
||
return <ChatList data={data} />; | ||
return ( | ||
<ChatList | ||
data={data} | ||
onActionClick={(key, id) => { | ||
switch (key) { | ||
case 'delete': | ||
deleteMessage(id); | ||
break; | ||
|
||
case 'regenerate': | ||
resendMessage(id); | ||
break; | ||
} | ||
}} | ||
style={{ marginTop: 24 }} | ||
/> | ||
); | ||
}; | ||
|
||
export default memo(List); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30da537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
lobe-chat-for-public – ./
lobe-chat.vercel.app
lobe-chat-for-public-git-master-lobehub.vercel.app
lobe-chat-for-public-lobehub.vercel.app
30da537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
lobe-chat – ./
lobe-chat-git-master-lobehub.vercel.app
lobe-chat-lobehub.vercel.app
chat.lobehub.com
lobeweb-chat.vercel.app