Some checks failed
CI/CD Pipeline / Backend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Build Backend (push) Has been cancelled
CI/CD Pipeline / Build Frontend (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Tests (push) Has been cancelled
CI/CD Pipeline / Dependency Updates (push) Has been cancelled
- Updated Anthropic API to latest version (2024-01-01) - Set Claude 3.7 Sonnet Latest as primary model - Removed deprecated Opus 3.5 references - Fixed LLM response validation and JSON parsing - Improved error handling and logging - Updated model configurations and pricing - Enhanced document processing reliability - Fixed TypeScript type issues - Updated environment configuration
14 lines
7.2 KiB
JavaScript
14 lines
7.2 KiB
JavaScript
import{c as e,j as s,F as r,a as t,E as n}from"./index-9817dacc.js";import{D as a}from"./download-aacd5336.js";import{C as c}from"./clock-9f043116.js";import{A as i,C as l}from"./check-circle-937a9172.js";
|
|
/**
|
|
* @license lucide-react v0.294.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const o=e("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]),d=e("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),x=e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),m=e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),u=({documents:e,onViewDocument:u,onDownloadDocument:h,onDeleteDocument:g,onRetryProcessing:f,onRefresh:p})=>{const y=e=>{if(0===e)return"0 Bytes";const s=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,s)).toFixed(2))+" "+["Bytes","KB","MB","GB"][s]},j=e=>{switch(e){case"uploaded":case"completed":return s.jsx(l,{className:"h-4 w-4 text-success-500"});case"processing":return s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-accent-500"});case"error":return s.jsx(i,{className:"h-4 w-4 text-error-500"});case"extracting_text":return s.jsx(c,{className:"h-4 w-4 text-warning-500"});default:return null}},w=(e,s,r)=>{switch(e){case"uploaded":return"Uploaded ✓";case"processing":return void 0!==s?`Processing... ${s}%`:r||"Processing...";case"completed":return"Completed ✓";case"error":return"Error";case"extracting_text":return"Extracting Text...";default:return""}},b=e=>{switch(e){case"uploaded":case"completed":return"text-success-600 bg-success-50";case"processing":return"text-accent-600 bg-accent-50";case"error":return"text-error-600 bg-error-50";case"extracting_text":return"text-warning-600 bg-warning-50";default:return"text-gray-600 bg-gray-50"}};return 0===e.length?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(r,{className:"mx-auto h-12 w-12 text-gray-400 mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-primary-800 mb-2",children:"No documents uploaded yet"}),s.jsx("p",{className:"text-gray-600",children:"Upload your first CIM document to get started with processing."})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h3",{className:"text-lg font-medium text-primary-800",children:["Documents (",e.length,")"]}),p&&s.jsxs("button",{onClick:p,className:"inline-flex items-center px-3 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]})]}),s.jsx("div",{className:"bg-white shadow-soft border border-gray-100 overflow-hidden sm:rounded-md",children:s.jsx("ul",{className:"divide-y divide-gray-200",children:e.map(e=>{return s.jsx("li",{children:s.jsx("div",{className:"px-4 py-4 sm:px-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[s.jsx(r,{className:"h-8 w-8 text-gray-400 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:e.name}),s.jsxs("span",{className:t("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",b(e.status)),children:[j(e.status),s.jsx("span",{className:"ml-1",children:w(e.status,e.progress,e.message)})]})]}),s.jsxs("div",{className:"mt-1 flex items-center space-x-4 text-sm text-gray-500",children:[s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(m,{className:"h-4 w-4"}),s.jsx("span",{children:e.uploadedBy})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(o,{className:"h-4 w-4"}),s.jsx("span",{children:(c=e.uploadedAt,new Date(c).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}))})]}),s.jsx("span",{children:y(e.fileSize)}),e.pageCount&&s.jsxs("span",{children:[e.pageCount," pages"]})]}),"processing"===e.status&&void 0!==e.progress&&s.jsxs("div",{className:"mt-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 mb-1",children:[s.jsx("span",{children:"Processing progress"}),s.jsxs("span",{children:[e.progress,"%"]})]}),s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:s.jsx("div",{className:"bg-accent-500 h-2 rounded-full transition-all duration-300",style:{width:`${e.progress}%`}})})]}),"completed"===e.status&&s.jsx("p",{className:"mt-2 text-sm text-success-600",children:'✓ Analysis completed - Click "View" to see detailed CIM review'}),e.error&&s.jsxs("p",{className:"mt-2 text-sm text-red-600",children:["Error: ",e.error]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2 ml-4",children:["completed"===e.status&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:()=>null==u?void 0:u(e.id),className:"inline-flex items-center px-3 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(n,{className:"h-4 w-4 mr-1"}),"View"]}),s.jsxs("button",{onClick:()=>null==h?void 0:h(e.id),className:"inline-flex items-center px-3 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(a,{className:"h-4 w-4 mr-1"}),"Download"]})]}),"error"===e.status&&f&&s.jsxs("button",{onClick:()=>f(e.id),className:"inline-flex items-center px-3 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(d,{className:"h-4 w-4 mr-1"}),"Retry"]}),s.jsxs("button",{onClick:()=>null==g?void 0:g(e.id),className:"inline-flex items-center px-3 py-1.5 border border-red-300 shadow-sm text-xs font-medium rounded text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500",children:[s.jsx(x,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]})})},e.id);var c})})})]})};
|
|
/**
|
|
* @license lucide-react v0.294.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/export{u as default};
|