feat(captain): show document conversation usage

This commit is contained in:
aakashb95
2026-07-21 12:07:31 +05:30
parent 2ccb466598
commit da88b45f57
3 changed files with 15 additions and 1 deletions
@@ -70,6 +70,10 @@ const props = defineProps({
type: Number,
default: 0,
},
usedInConversationsCount: {
type: Number,
default: 0,
},
isSelected: {
type: Boolean,
default: false,
@@ -150,6 +154,11 @@ const createdAtLabel = computed(() => dynamicTime(props.createdAt));
const responsesCountLabel = computed(() =>
t('CAPTAIN.DOCUMENTS.FAQ_COUNT', { n: props.responsesCount })
);
const usedInConversationsCountLabel = computed(() =>
t('CAPTAIN.DOCUMENTS.USED_IN_CONVERSATIONS', {
n: props.usedInConversationsCount,
})
);
const displayLink = computed(() =>
isPdf.value
@@ -216,7 +225,7 @@ const handleRetry = () => {
</div>
</div>
</div>
<div class="flex gap-4 justify-between items-center w-full">
<div class="flex flex-wrap gap-4 justify-between items-center w-full">
<span
class="flex gap-1 items-center text-sm truncate shrink-0 text-n-slate-11"
>
@@ -246,6 +255,9 @@ const handleRetry = () => {
<span class="text-sm shrink-0 text-n-slate-11">
{{ responsesCountLabel }}
</span>
<span class="text-sm shrink-0 text-n-slate-11">
{{ usedInConversationsCountLabel }}
</span>
<DocumentSyncStatus
v-if="showSyncStatus"
:status="syncStatus"
@@ -819,6 +819,7 @@
"HEADER": "Documents",
"ADD_NEW": "Create a new document",
"FAQ_COUNT": "{n} FAQ | {n} FAQs",
"USED_IN_CONVERSATIONS": "Used in {n} conversation | Used in {n} conversations",
"SELECTED": "{count} selected",
"SELECT_ALL": "Select all ({count})",
"UNSELECT_ALL": "Unselect all ({count})",
@@ -417,6 +417,7 @@ onUnmounted(() => {
:sync-in-progress="doc.sync_in_progress"
:sync-stale-after-hours="syncIntervalHours"
:responses-count="doc.responses_count"
:used-in-conversations-count="doc.used_in_conversations_count"
:is-selected="canManageDocuments && bulkSelectedIds.has(doc.id)"
:selectable="canManageDocuments"
:show-selection-control="shouldShowSelectionControl(doc.id)"