![]() 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.ca/private_html/.next/server/chunks/ |
"use strict";exports.id=3337,exports.ids=[3337],exports.modules={47864:(e,s,r)=>{r.d(s,{A:()=>a});let a=(0,r(72386).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"}]])},53337:(e,s,r)=>{r.d(s,{A:()=>f});var a=r(8732),t=r(82015),l=r(4722),i=r(44233),n=r(13213),c=r(66399),d=r(84904),o=r(74498),x=r(41919),m=r(6159),h=r(35091),g=r(30703),u=r(13838),p=r(57341),b=r(5453),j=r(27290),y=r(47864),N=r(99421);let f=({title:e="Case Management",maxCases:s=5,showCreateButton:r=!0,showViewAll:f=!0,showMyCases:v=!1,showAssignedCases:w=!1,showPublicCases:A=!1,showFilters:C=!0,className:k=""})=>{let{data:S}=(0,l.useSession)(),L=(0,i.useRouter)(),[$,z]=(0,t.useState)([]),[E,M]=(0,t.useState)(!0),[P,q]=(0,t.useState)(""),[R,U]=(0,t.useState)(""),[D,F]=(0,t.useState)("all");(0,t.useEffect)(()=>{S?.user&&V()},[S]);let V=async()=>{try{M(!0);let e=new URLSearchParams;v&&e.append("myCases","true"),w&&e.append("assignedCases","true"),A&&e.append("publicCases","true");let s=await fetch(`/api/cases?${e.toString()}`,{credentials:"same-origin"});if(s.ok){let e=await s.json();z(e.cases||[])}else q("Failed to fetch cases")}catch(e){console.error("Error fetching cases:",e),q("Error loading cases")}finally{M(!1)}},H=e=>{switch(e){case"active":return(0,a.jsx)(n.A,{className:"h-4 w-4 text-green-500"});case"pending":return(0,a.jsx)(c.A,{className:"h-4 w-4 text-yellow-500"});case"closed":return(0,a.jsx)(d.A,{className:"h-4 w-4 text-gray-500"});case"suspended":return(0,a.jsx)(o.A,{className:"h-4 w-4 text-red-500"});default:return(0,a.jsx)(c.A,{className:"h-4 w-4 text-gray-400"})}},Y=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"}},_=$.filter(e=>e.title.toLowerCase().includes(R.toLowerCase())||e.description.toLowerCase().includes(R.toLowerCase())||e.caseNumber&&e.caseNumber.toLowerCase().includes(R.toLowerCase())).filter(e=>"all"===D||e.status===D).slice(0,s),B=()=>{L.push("/hire/new-case")},G=e=>{L.push(`/admin/cases/${e}`)},I=e=>{L.push(`/admin/cases/${e}?edit=true`)};return E?(0,a.jsxs)("div",{className:`bg-white rounded-lg shadow-sm border ${k}`,children:[(0,a.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e}),r&&(0,a.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,a.jsx)(x.A,{className:"h-4 w-4 mr-1"}),"Create Case"]})]})}),(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)("div",{className:"space-y-3",children:[void 0,void 0,void 0].map((e,s)=>(0,a.jsx)("div",{className:"animate-pulse",children:(0,a.jsx)("div",{className:"h-20 bg-gray-200 rounded"})},s))})})]}):P?(0,a.jsxs)("div",{className:`bg-white rounded-lg shadow-sm border ${k}`,children:[(0,a.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e})}),(0,a.jsx)("div",{className:"p-6",children:(0,a.jsxs)("div",{className:"text-center py-4",children:[(0,a.jsx)(o.A,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-red-600",children:P}),(0,a.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:V,children:"Retry"})]})})]}):(0,a.jsxs)("div",{className:`bg-white rounded-lg shadow-sm border ${k}`,children:[(0,a.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-5 w-5"}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e}),(0,a.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})]}),r&&(0,a.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:B,title:"Create a new case",children:[(0,a.jsx)(x.A,{className:"h-4 w-4 mr-1"}),"Create Case"]})]})}),(0,a.jsxs)("div",{className:"p-6 space-y-4",children:[C&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)(h.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search cases...",value:R,onChange:e=>U(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,a.jsxs)("select",{value:D,onChange:e=>F(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,a.jsx)("option",{value:"all",children:"All Status"}),(0,a.jsx)("option",{value:"active",children:"Active"}),(0,a.jsx)("option",{value:"pending",children:"Pending"}),(0,a.jsx)("option",{value:"closed",children:"Closed"}),(0,a.jsx)("option",{value:"suspended",children:"Suspended"})]})]}),0===_.length?(0,a.jsxs)("div",{className:"text-center py-8",children:[(0,a.jsx)(m.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-3"}),(0,a.jsx)("p",{className:"text-gray-500 mb-2",children:R||"all"!==D?"No cases match your search criteria":"No cases found"}),r&&(0,a.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:B,children:[(0,a.jsx)(x.A,{className:"h-4 w-4 mr-1"}),"Create Your First Case"]})]}):(0,a.jsx)("div",{className:"space-y-3",children:_.map(e=>(0,a.jsxs)("div",{className:"border rounded-lg p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>G(e.id),children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:e.logoUrl?(0,a.jsx)("img",{src:e.logoUrl,alt:`${e.title} Logo`,className:"w-12 h-12 rounded-lg object-cover border border-gray-200"}):(0,a.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,a.jsx)(g.A,{className:"w-6 h-6 text-gray-600"})})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-900 truncate",children:e.title}),e.caseNumber&&(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:["#",e.caseNumber]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-2",children:[H(e.status),(0,a.jsx)("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${Y(e.priority)}`,children:e.priority})]})]}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:e.description}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(u.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:e.leadLawyer.name})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(p.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:e.jurisdiction})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(b.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:(0,a.jsxs)("span",{children:[e._count.registrations," applications"]})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[(0,a.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(),G(e.id)},children:[(0,a.jsx)(j.A,{className:"h-3 w-3 mr-1"}),"View"]}),(0,a.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,a.jsx)(y.A,{className:"h-3 w-3 mr-1"}),"Edit"]}),e.budget&&(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:[(0,a.jsx)(N.A,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:["$",e.budget.toLocaleString()]})]})]})]},e.id))}),f&&$.length>s&&(0,a.jsx)("div",{className:"text-center pt-4 border-t",children:(0,a.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:()=>{L.push("/admin/cases")},children:["View All Cases (",$.length,")"]})})]})]})}},57341:(e,s,r)=>{r.d(s,{A:()=>a});let a=(0,r(72386).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"}]])},84904:(e,s,r)=>{r.d(s,{A:()=>a});let a=(0,r(72386).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"}]])}};