feat: show dataset item thumbnails
This commit is contained in:
@@ -868,6 +868,19 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.explore-article-item.has-image {
|
||||
grid-template-columns: 30px minmax(0, 1fr) 76px;
|
||||
}
|
||||
|
||||
.explore-article-thumbnail {
|
||||
width: 76px;
|
||||
height: 58px;
|
||||
align-self: center;
|
||||
border-radius: 8px;
|
||||
background: var(--senlin-panel-muted);
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.explore-article-item:hover,
|
||||
.explore-article-item.active {
|
||||
background: color-mix(in srgb, var(--senlin-primary) 8%, var(--senlin-panel));
|
||||
|
||||
@@ -391,7 +391,11 @@ export function WorkspaceExplorePage({
|
||||
return (
|
||||
<button
|
||||
key={item.id}
|
||||
className={item.id === selected.id ? 'explore-article-item active' : 'explore-article-item'}
|
||||
className={[
|
||||
'explore-article-item',
|
||||
item.id === selected.id ? 'active' : '',
|
||||
item.imageUrl ? 'has-image' : '',
|
||||
].filter(Boolean).join(' ')}
|
||||
onClick={() => setActiveItemID(item.id)}
|
||||
>
|
||||
<span className={`explore-source-logo ${itemSource.color}`}>{sourceInitial(itemSource.name)}</span>
|
||||
@@ -402,6 +406,15 @@ export function WorkspaceExplorePage({
|
||||
{item.summary || '暂无摘要'}
|
||||
</Text>
|
||||
</span>
|
||||
{item.imageUrl ? (
|
||||
<img
|
||||
className="explore-article-thumbnail"
|
||||
src={item.imageUrl}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
referrerPolicy="no-referrer"
|
||||
/>
|
||||
) : null}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user