feat: Phase 1B — DocumentCard/TagPill/FormatIcon 컴포넌트
- DocumentCard: 포맷 아이콘, 제목+요약, domain 경로, 태그 pill, data_origin 배지, 날짜, 파일 크기 - TagPill: 계층별 색상 (@amber, #blue, $green, !red), 클릭→필터 - FormatIcon: 파일 포맷별 lucide 아이콘 매핑 - documents 페이지에서 DocumentCard 컴포넌트 사용 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { api } from '$lib/api';
|
||||
import { addToast } from '$lib/stores/ui';
|
||||
import DocumentCard from '$lib/components/DocumentCard.svelte';
|
||||
|
||||
let documents = $state([]);
|
||||
let total = $state(0);
|
||||
@@ -182,36 +183,7 @@
|
||||
{:else}
|
||||
<div class="space-y-1.5">
|
||||
{#each items as doc}
|
||||
<a
|
||||
href="/documents/{doc.id}"
|
||||
class="flex items-center justify-between p-3 bg-[var(--surface)] border border-[var(--border)] rounded-lg hover:border-[var(--accent)] transition-colors group"
|
||||
>
|
||||
<div class="flex items-center gap-3 min-w-0">
|
||||
<span class="text-[10px] px-1.5 py-0.5 rounded bg-[var(--border)] text-[var(--text-dim)] uppercase shrink-0 font-mono">{doc.file_format}</span>
|
||||
<div class="min-w-0">
|
||||
<p class="text-sm font-medium truncate group-hover:text-[var(--accent)]">{doc.title || '제목 없음'}</p>
|
||||
<div class="flex items-center gap-2 mt-0.5">
|
||||
{#if doc.ai_domain}
|
||||
<span class="text-[10px] text-[var(--text-dim)]">{doc.ai_domain.replace('Knowledge/', '')}{doc.ai_sub_group ? ` / ${doc.ai_sub_group}` : ''}</span>
|
||||
{/if}
|
||||
{#if doc.ai_summary}
|
||||
<span class="text-[10px] text-[var(--text-dim)] truncate max-w-xs hidden sm:inline">· {doc.ai_summary?.slice(0, 80)}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 shrink-0 ml-3">
|
||||
{#if doc.ai_tags?.length}
|
||||
<span class="text-[10px] text-[var(--accent)] hidden md:inline">{doc.ai_tags[0]}</span>
|
||||
{/if}
|
||||
{#if doc.score !== undefined}
|
||||
<span class="text-[10px] text-[var(--accent)]">{(doc.score * 100).toFixed(0)}%</span>
|
||||
{/if}
|
||||
{#if doc.data_origin}
|
||||
<span class="text-[10px] px-1.5 py-0.5 rounded {doc.data_origin === 'work' ? 'bg-blue-900/30 text-blue-400' : 'bg-gray-800 text-gray-400'}">{doc.data_origin}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</a>
|
||||
<DocumentCard {doc} showDomain={!filterDomain} />
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user