mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 00:46:52 +08:00
### 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):
32 lines
958 B
TypeScript
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)}
|
|
/>
|
|
);
|
|
}
|