Files
ragflow/web/src/pages/next-chats/chat-card.tsx
TeslaZY 7d3bb3a2f9 Fix dataset card not responding to click events (#9574)
### What problem does this PR solve?

Fix home card not responding to click events

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
2025-08-20 10:06:14 +08:00

32 lines
958 B
TypeScript

import { HomeCard } from '@/components/home-card';
import { MoreButton } from '@/components/more-button';
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
import { IDialog } from '@/interfaces/database/chat';
import { ChatDropdown } from './chat-dropdown';
import { useRenameChat } from './hooks/use-rename-chat';
export type IProps = {
data: IDialog;
} & Pick<ReturnType<typeof useRenameChat>, 'showChatRenameModal'>;
export function ChatCard({ data, showChatRenameModal }: IProps) {
const { navigateToChat } = useNavigatePage();
return (
<HomeCard
data={{
name: data.name,
description: data.description,
avatar: data.icon,
update_time: data.update_time,
}}
moreDropdown={
<ChatDropdown chat={data} showChatRenameModal={showChatRenameModal}>
<MoreButton></MoreButton>
</ChatDropdown>
}
onClick={navigateToChat(data?.id)}
/>
);
}