Skip to content

Commit d0e4162

Browse files
committed
🐛 Fixes
1 parent 2470d83 commit d0e4162

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

src/components/ArtifactPreviewCard.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ const WIDGET_ICONS: Record<CodeBlockType, IconName> = {
9494
generic: 'Code',
9595
}
9696

97+
const WIDGET_LABELS: Record<CodeBlockType, string> = {
98+
abc: 'Score',
99+
svg: 'SVG',
100+
diagram: 'Diagram',
101+
marpit: 'Presentation',
102+
html: 'HTML',
103+
generic: 'Code',
104+
}
105+
97106
// ============================================================================
98107
// Component
99108
// ============================================================================
@@ -172,6 +181,13 @@ export const ArtifactPreviewCard = memo(
172181
item.kind === 'artifact'
173182
? (ARTIFACT_ICONS[item.artifact.type] ?? 'Page')
174183
: WIDGET_ICONS[item.widget.widgetType]
184+
const statusLabel =
185+
item.kind === 'artifact' ? item.artifact.status : undefined
186+
const typeLabel =
187+
item.kind === 'artifact'
188+
? item.artifact.type
189+
: WIDGET_LABELS[item.widget.widgetType]
190+
175191
// ---- Landscape card ----
176192
if (layout === 'landscape') {
177193
return (
@@ -233,10 +249,10 @@ export const ArtifactPreviewCard = memo(
233249
onPress={handlePress}
234250
>
235251
<CardBody className="flex flex-row items-center gap-2 sm:gap-3 p-2 sm:p-3">
236-
{/* <div className="flex items-center justify-center w-8 h-8 sm:w-10 sm:h-10 rounded-medium bg-default-100 shrink-0">
252+
<div className="flex items-center justify-center w-8 h-8 sm:w-10 sm:h-10 rounded-medium bg-default-100 shrink-0">
237253
<Icon name={icon} size="md" className="text-default-500" />
238-
</div> */}
239-
{/* <div className="flex flex-col min-w-0 flex-1 overflow-hidden">
254+
</div>
255+
<div className="flex flex-col min-w-0 flex-1 overflow-hidden">
240256
<span className="font-medium text-xs sm:text-sm truncate">
241257
{title}
242258
</span>
@@ -249,7 +265,7 @@ export const ArtifactPreviewCard = memo(
249265
<span className="ml-1">· {statusLabel}</span>
250266
)}
251267
</span>
252-
</div> */}
268+
</div>
253269
{preview ? (
254270
<img
255271
src={preview}

src/pages/Tasks/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState, useMemo } from 'react'
22
import { useNavigate } from 'react-router-dom'
3-
import { Card, CardBody, Chip, Pagination } from '@heroui/react'
3+
import { Card, CardBody, Chip, Pagination, Spinner } from '@heroui/react'
44

55
import { useI18n } from '@/i18n'
66
import {

0 commit comments

Comments
 (0)