mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Fix (next search): Optimize the search problem interface and related functions #3221 -Add search_id to the retrievval_test interface -Optimize handleSearchStrChange and handleSearch callbacks to determine whether to enable AI search based on search configuration ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1,10 +1,8 @@
|
||||
import { HomeCard } from '@/components/home-card';
|
||||
import { MoreButton } from '@/components/more-button';
|
||||
import { RAGFlowAvatar } from '@/components/ragflow-avatar';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
||||
import { IKnowledge } from '@/interfaces/database/knowledge';
|
||||
import { formatDate } from '@/utils/date';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { DatasetDropdown } from './dataset-dropdown';
|
||||
import { useDisplayOwnerName } from './use-display-owner';
|
||||
@ -24,47 +22,20 @@ export function DatasetCard({
|
||||
const owner = displayOwnerName(dataset.tenant_id, dataset.nickname);
|
||||
|
||||
return (
|
||||
<Card
|
||||
key={dataset.id}
|
||||
className="w-40"
|
||||
onClick={navigateToDataset(dataset.id)}
|
||||
>
|
||||
<CardContent className="p-2.5 pt-2 group">
|
||||
<section className="flex justify-between mb-2">
|
||||
<div className="flex gap-2 items-center">
|
||||
<RAGFlowAvatar
|
||||
className="size-6 rounded-lg"
|
||||
avatar={dataset.avatar}
|
||||
name={dataset.name || 'CN'}
|
||||
></RAGFlowAvatar>
|
||||
{owner && (
|
||||
<Badge className="h-5 rounded-sm px-1 bg-background-badge text-text-badge">
|
||||
{owner}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<DatasetDropdown
|
||||
showDatasetRenameModal={showDatasetRenameModal}
|
||||
dataset={dataset}
|
||||
>
|
||||
<MoreButton></MoreButton>
|
||||
</DatasetDropdown>
|
||||
</section>
|
||||
<div className="flex justify-between items-end">
|
||||
<div className="w-full">
|
||||
<h3 className="text-lg font-semibold mb-2 line-clamp-1">
|
||||
{dataset.name}
|
||||
</h3>
|
||||
<p className="text-xs text-text-secondary">
|
||||
{dataset.doc_num} files
|
||||
</p>
|
||||
<p className="text-xs text-text-secondary">
|
||||
{formatDate(dataset.update_time)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<HomeCard
|
||||
data={{ ...dataset, description: `${dataset.doc_num} files` }}
|
||||
moreDropdown={
|
||||
<DatasetDropdown
|
||||
showDatasetRenameModal={showDatasetRenameModal}
|
||||
dataset={dataset}
|
||||
>
|
||||
<MoreButton></MoreButton>
|
||||
</DatasetDropdown>
|
||||
}
|
||||
onClick={() => {
|
||||
navigateToDataset(dataset.id);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user