diff --git a/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue b/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue index d6e546581..d0e85d246 100644 --- a/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue +++ b/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue @@ -26,6 +26,10 @@ const props = defineProps({ type: String, required: true, }, + file: { + type: Object, + default: null, + }, createdAt: { type: Number, required: true, @@ -63,6 +67,22 @@ const menuItems = computed(() => { const createdAt = computed(() => dynamicTime(props.createdAt)); +const displayLink = computed(() => { + // For PDF uploads, show the filename instead of the generated external_link + if (props.file?.filename) { + return props.file.filename; + } + return props.externalLink; +}); + +const actualLink = computed(() => { + // For PDF uploads, return the actual file URL; for URLs, return the external_link + if (props.file?.url) { + return props.file.url; + } + return props.externalLink; +}); + const handleAction = ({ action, value }) => { toggleDropdown(false); emit('action', { action, value, id: props.id }); @@ -103,12 +123,15 @@ const handleAction = ({ action, value }) => { {{ assistant?.name || '' }} - - {{ externalLink }} - + {{ displayLink }} +