Feat: Bind data to the agent module of the home page #3221 (#7385)

### What problem does this PR solve?

Feat: Bind data to the agent module of the home page #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-04-29 09:50:54 +08:00
committed by GitHub
parent c7310f7fb2
commit 5bb1c383ac
26 changed files with 260 additions and 187 deletions

View File

@ -26,17 +26,21 @@ export function DatasetCard({
return (
<Card
key={dataset.id}
className="bg-colors-background-inverse-weak flex-1"
className="bg-colors-background-inverse-weak w-40"
onClick={navigateToDataset(dataset.id)}
>
<CardContent className="p-4">
<section className="flex justify-between mb-4">
<div className="flex gap-2">
<Avatar className="w-[70px] h-[70px] rounded-lg">
<CardContent className="p-2.5 pt-1">
<section className="flex justify-between mb-2">
<div className="flex gap-2 items-center">
<Avatar className="size-6 rounded-lg">
<AvatarImage src={dataset.avatar} />
<AvatarFallback className="rounded-lg">CN</AvatarFallback>
<AvatarFallback className="rounded-lg ">CN</AvatarFallback>
</Avatar>
{owner && <Badge className="h-5">{owner}</Badge>}
{owner && (
<Badge className="h-5 rounded-sm px-1 bg-background-badge text-text-badge">
{owner}
</Badge>
)}
</div>
<DatasetDropdown
showDatasetRenameModal={showDatasetRenameModal}
@ -48,13 +52,13 @@ export function DatasetCard({
</DatasetDropdown>
</section>
<div className="flex justify-between items-end">
<div>
<div className="w-full">
<h3 className="text-lg font-semibold mb-2 line-clamp-1">
{dataset.name}
</h3>
<p className="text-sm opacity-80">{dataset.doc_num} files</p>
<p className="text-sm opacity-80">
Created {formatDate(dataset.update_time)}
<p className="text-xs opacity-80">{dataset.doc_num} files</p>
<p className="text-xs opacity-80">
{formatDate(dataset.update_time)}
</p>
</div>
</div>