diff --git a/frontend/src/lib/components/DocumentCard.svelte b/frontend/src/lib/components/DocumentCard.svelte new file mode 100644 index 0000000..274d636 --- /dev/null +++ b/frontend/src/lib/components/DocumentCard.svelte @@ -0,0 +1,79 @@ + + + + +
+ +
+ + +
+ +

+ {doc.title || '제목 없음'} +

+ + + {#if doc.ai_summary} +

{doc.ai_summary.slice(0, 100)}

+ {/if} + + +
+ {#if showDomain && doc.ai_domain} + + {doc.ai_domain.replace('Knowledge/', '')}{doc.ai_sub_group ? ` / ${doc.ai_sub_group}` : ''} + + {/if} + {#if doc.ai_tags?.length} +
+ {#each doc.ai_tags.slice(0, 3) as tag} + + {/each} +
+ {/if} +
+
+ + +
+ {#if doc.score !== undefined} + {(doc.score * 100).toFixed(0)}% + {/if} + {#if doc.data_origin} + + {doc.data_origin} + + {/if} + {formatDate(doc.created_at)} + {#if doc.file_size} + {formatSize(doc.file_size)} + {/if} +
+
diff --git a/frontend/src/lib/components/FormatIcon.svelte b/frontend/src/lib/components/FormatIcon.svelte new file mode 100644 index 0000000..a23e724 --- /dev/null +++ b/frontend/src/lib/components/FormatIcon.svelte @@ -0,0 +1,30 @@ + + + diff --git a/frontend/src/lib/components/TagPill.svelte b/frontend/src/lib/components/TagPill.svelte new file mode 100644 index 0000000..8c401d3 --- /dev/null +++ b/frontend/src/lib/components/TagPill.svelte @@ -0,0 +1,40 @@ + + +{#if clickable} + +{:else} + + {tag} + +{/if} diff --git a/frontend/src/routes/documents/+page.svelte b/frontend/src/routes/documents/+page.svelte index 3ff06fb..89dc07d 100644 --- a/frontend/src/routes/documents/+page.svelte +++ b/frontend/src/routes/documents/+page.svelte @@ -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}
{#each items as doc} - -
- {doc.file_format} -
-

{doc.title || '제목 없음'}

-
- {#if doc.ai_domain} - {doc.ai_domain.replace('Knowledge/', '')}{doc.ai_sub_group ? ` / ${doc.ai_sub_group}` : ''} - {/if} - {#if doc.ai_summary} - - {/if} -
-
-
-
- {#if doc.ai_tags?.length} - - {/if} - {#if doc.score !== undefined} - {(doc.score * 100).toFixed(0)}% - {/if} - {#if doc.data_origin} - {doc.data_origin} - {/if} -
-
+ {/each}