![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.quebec/public_html/_next/static/chunks/ |
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6112],{3609:(e,s,a)=>{a.d(s,{A:()=>r});let r=(0,a(11713).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},70641:(e,s,a)=>{a.d(s,{A:()=>r});let r=(0,a(11713).A)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},96112:(e,s,a)=>{a.d(s,{A:()=>f});var r=a(37876),t=a(14232),l=a(10553),c=a(89099),n=a(498),i=a(20710),d=a(3609),o=a(55851),x=a(65104),m=a(69976),h=a(79516),g=a(65390),u=a(72671),p=a(99652),b=a(33654),j=a(42341),y=a(70641),N=a(59116);let f=e=>{let{title:s="Case Management",maxCases:a=5,showCreateButton:f=!0,showViewAll:v=!0,showMyCases:w=!1,showAssignedCases:C=!1,showPublicCases:A=!1,showFilters:k=!0,className:S=""}=e,{data:L}=(0,l.useSession)(),E=(0,c.useRouter)(),[_,z]=(0,t.useState)([]),[M,P]=(0,t.useState)(!0),[q,R]=(0,t.useState)(""),[U,D]=(0,t.useState)(""),[F,V]=(0,t.useState)("all");(0,t.useEffect)(()=>{(null==L?void 0:L.user)&&H()},[L]);let H=async()=>{try{P(!0);let e=new URLSearchParams;w&&e.append("myCases","true"),C&&e.append("assignedCases","true"),A&&e.append("publicCases","true");let s=await fetch("/api/cases?".concat(e.toString()),{credentials:"same-origin"});if(s.ok){let e=await s.json();z(e.cases||[])}else R("Failed to fetch cases")}catch(e){console.error("Error fetching cases:",e),R("Error loading cases")}finally{P(!1)}},Y=e=>{switch(e){case"active":return(0,r.jsx)(n.A,{className:"h-4 w-4 text-green-500"});case"pending":return(0,r.jsx)(i.A,{className:"h-4 w-4 text-yellow-500"});case"closed":return(0,r.jsx)(d.A,{className:"h-4 w-4 text-gray-500"});case"suspended":return(0,r.jsx)(o.A,{className:"h-4 w-4 text-red-500"});default:return(0,r.jsx)(i.A,{className:"h-4 w-4 text-gray-400"})}},$=e=>{switch(e){case"urgent":return"bg-red-100 text-red-800 border-red-200";case"high":return"bg-orange-100 text-orange-800 border-orange-200";case"medium":return"bg-blue-100 text-blue-800 border-blue-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},B=_.filter(e=>e.title.toLowerCase().includes(U.toLowerCase())||e.description.toLowerCase().includes(U.toLowerCase())||e.caseNumber&&e.caseNumber.toLowerCase().includes(U.toLowerCase())).filter(e=>"all"===F||e.status===F).slice(0,a),G=()=>{E.push("/hire/new-case")},I=e=>{E.push("/admin/cases/".concat(e))},J=e=>{E.push("/admin/cases/".concat(e,"?edit=true"))};return M?(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border ".concat(S),children:[(0,r.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:s}),f&&(0,r.jsxs)("button",{className:"inline-flex items-center px-3 py-2 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!0,children:[(0,r.jsx)(x.A,{className:"h-4 w-4 mr-1"}),"Create Case"]})]})}),(0,r.jsx)("div",{className:"p-6",children:(0,r.jsx)("div",{className:"space-y-3",children:[void 0,void 0,void 0].map((e,s)=>(0,r.jsx)("div",{className:"animate-pulse",children:(0,r.jsx)("div",{className:"h-20 bg-gray-200 rounded"})},s))})})]}):q?(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border ".concat(S),children:[(0,r.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:s})}),(0,r.jsx)("div",{className:"p-6",children:(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)(o.A,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),(0,r.jsx)("p",{className:"text-red-600",children:q}),(0,r.jsx)("button",{className:"inline-flex items-center px-3 py-2 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors mt-2",onClick:H,children:"Retry"})]})})]}):(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border ".concat(S),children:[(0,r.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(m.A,{className:"h-5 w-5"}),(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:s}),(0,r.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:_.length})]}),f&&(0,r.jsxs)("button",{className:"inline-flex items-center px-3 py-2 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 transition-colors",onClick:G,title:"Create a new case",children:[(0,r.jsx)(x.A,{className:"h-4 w-4 mr-1"}),"Create Case"]})]})}),(0,r.jsxs)("div",{className:"p-6 space-y-4",children:[k&&(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)(h.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,r.jsx)("input",{type:"text",placeholder:"Search cases...",value:U,onChange:e=>D(e.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),(0,r.jsxs)("select",{value:F,onChange:e=>V(e.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-32",children:[(0,r.jsx)("option",{value:"all",children:"All Status"}),(0,r.jsx)("option",{value:"active",children:"Active"}),(0,r.jsx)("option",{value:"pending",children:"Pending"}),(0,r.jsx)("option",{value:"closed",children:"Closed"}),(0,r.jsx)("option",{value:"suspended",children:"Suspended"})]})]}),0===B.length?(0,r.jsxs)("div",{className:"text-center py-8",children:[(0,r.jsx)(m.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-3"}),(0,r.jsx)("p",{className:"text-gray-500 mb-2",children:U||"all"!==F?"No cases match your search criteria":"No cases found"}),f&&(0,r.jsxs)("button",{className:"inline-flex items-center px-3 py-2 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors",onClick:G,children:[(0,r.jsx)(x.A,{className:"h-4 w-4 mr-1"}),"Create Your First Case"]})]}):(0,r.jsx)("div",{className:"space-y-3",children:B.map(e=>(0,r.jsxs)("div",{className:"border rounded-lg p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>I(e.id),children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mb-2",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:e.logoUrl?(0,r.jsx)("img",{src:e.logoUrl,alt:"".concat(e.title," Logo"),className:"w-12 h-12 rounded-lg object-cover border border-gray-200"}):(0,r.jsx)("div",{className:"w-12 h-12 rounded-lg bg-gradient-to-br from-blue-500/20 to-indigo-500/20 border border-gray-200 flex items-center justify-center",children:(0,r.jsx)(g.A,{className:"w-6 h-6 text-gray-600"})})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-900 truncate",children:e.title}),e.caseNumber&&(0,r.jsxs)("p",{className:"text-sm text-gray-500",children:["#",e.caseNumber]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-2",children:[Y(e.status),(0,r.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ".concat($(e.priority)),children:e.priority})]})]}),(0,r.jsx)("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:e.description}),(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(u.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{children:e.leadLawyer.name})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(p.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{children:e.jurisdiction})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(b.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:(0,r.jsxs)("span",{children:[e._count.registrations," applications"]})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[(0,r.jsxs)("button",{className:"inline-flex items-center px-3 py-2 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors",onClick:s=>{s.stopPropagation(),I(e.id)},children:[(0,r.jsx)(j.A,{className:"h-3 w-3 mr-1"}),"View"]}),(0,r.jsxs)("button",{className:"inline-flex items-center px-3 py-2 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors",onClick:s=>{s.stopPropagation(),J(e.id)},children:[(0,r.jsx)(y.A,{className:"h-3 w-3 mr-1"}),"Edit"]}),e.budget&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:[(0,r.jsx)(N.A,{className:"h-3 w-3"}),(0,r.jsxs)("span",{children:["$",e.budget.toLocaleString()]})]})]})]},e.id))}),v&&_.length>a&&(0,r.jsx)("div",{className:"text-center pt-4 border-t",children:(0,r.jsxs)("button",{className:"inline-flex items-center px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",onClick:()=>{E.push("/admin/cases")},children:["View All Cases (",_.length,")"]})})]})]})}},99652:(e,s,a)=>{a.d(s,{A:()=>r});let r=(0,a(11713).A)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])}}]);