From a873e3467cff2411cd7a8ba86971c4d2c4280f6a Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Mon, 21 Apr 2025 05:47:03 +0100 Subject: [PATCH] wip --- .../app/dashboard/agents/[threadId]/page.tsx | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/frontend/src/app/dashboard/agents/[threadId]/page.tsx b/frontend/src/app/dashboard/agents/[threadId]/page.tsx index 36b3ac0e..fd3ee938 100644 --- a/frontend/src/app/dashboard/agents/[threadId]/page.tsx +++ b/frontend/src/app/dashboard/agents/[threadId]/page.tsx @@ -113,37 +113,43 @@ function renderMarkdownContent(content: string, handleToolClick: (assistantMessa {askContent} {attachments.length > 0 && ( -
-
Attachments:
-
+
+
{attachments.map((attachment, idx) => { const extension = attachment.split('.').pop()?.toLowerCase(); - const isImage = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'].includes(extension || ''); - const isPdf = extension === 'pdf'; - const isMd = extension === 'md'; - const isCode = ['js', 'jsx', 'ts', 'tsx', 'py', 'html', 'css', 'json'].includes(extension || ''); + const filename = attachment.split('/').pop() || 'file'; - let icon = ; - if (isImage) icon = ; - if (isPdf) icon = ; - if (isMd) icon = ; - if (isCode) icon = ; + // Define file size (in a real app, this would come from the backend) + const fileSize = + extension === 'html' ? '52.68 KB' : + attachment.includes('itinerary') ? '4.14 KB' : + attachment.includes('proposal') ? '6.20 KB' : + attachment.includes('todo') ? '1.89 KB' : + attachment.includes('research') ? '3.75 KB' : + `${(Math.random() * 5 + 1).toFixed(2)} KB`; + + // Get file type display + const fileType = extension === 'html' ? 'Code' : 'Text'; return ( ); })} @@ -1410,3 +1416,4 @@ export default function ThreadPage({ params }: { params: Promise }
); } +