mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-22 22:26:43 +08:00
### What problem does this PR solve? Feat: Switch the root route to the new page #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,15 +1,20 @@
|
||||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
||||
import { useFetchDialogList } from '@/hooks/use-chat-request';
|
||||
import { ApplicationCard } from './application-card';
|
||||
|
||||
export function ChatList() {
|
||||
const { data } = useFetchDialogList();
|
||||
const { navigateToChat } = useNavigatePage();
|
||||
|
||||
return data.dialogs
|
||||
.slice(0, 10)
|
||||
.map((x) => (
|
||||
<ApplicationCard
|
||||
key={x.id}
|
||||
app={{ avatar: x.icon, title: x.name, update_time: x.update_time }}
|
||||
></ApplicationCard>
|
||||
));
|
||||
return data.dialogs.slice(0, 10).map((x) => (
|
||||
<ApplicationCard
|
||||
key={x.id}
|
||||
app={{
|
||||
avatar: x.icon,
|
||||
title: x.name,
|
||||
update_time: x.update_time,
|
||||
}}
|
||||
onClick={navigateToChat(x.id)}
|
||||
></ApplicationCard>
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user