PageSourceSearch

https://app.metty.ai/assets/ReceivedOrderInfo-hkI5Lfm4.js

js metty.ai collected 2026-10-05 14:00:30 UTC 34,458 bytes, 6 lines download raw bytes

1import{aC as ve,bj as we,bh as Se,b0 as d,be as Ce,aw as u,aU as e,q as se,b as E,a3 as De,l as Ee,s as I,v as m,ac as Ie,D as Me,aq as Pe,ad as te,g as de,x as le,Y as Te,ak as ne,C as $e,T as ie,m as Ae,aa as Fe,a5 as Le,H as Ue,W as Oe,h as Re,bo as M}from"./index-DzBlipNH.js";import{L as qe}from"./LayerContent-B4Jx8IGs.js";import{M as _e}from"./MilestoneTimeline-Juf23Mui.js";import{C as P}from"./copy-CHrcEgpE.js";import{C as Ge}from"./credit-card-LX8cC0sK.js";import{T as ce}from"./tag-qarRE1PE.js";/**
2 * @license lucide-react v0.541.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Be=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],He=ve("file-check",Be),T=[{value:"IN_PROGRESS",label:"In Progress",color:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300"},{value:"DELIVERED",label:"Delivered",color:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-300"}],Je=()=>{var G,B,H,V,Y,z,Q,W,Z,J,K,X,ee,ae,re;const{id:b}=we(),oe=Se(),[a,xe]=d.useState(null),[ge,$]=d.useState(!0),[y,p]=d.useState(null),[me,A]=d.useState(null),[o,j]=d.useState("details"),[g,F]=d.useState(!1),[L,h]=d.useState(null),[U,N]=d.useState(null),[k,f]=d.useState(!1),[c,v]=d.useState(""),{user:l}=Ce(r=>r.auth),[he,ue]=d.useState(!1),[be,ye]=d.useState([]),[pe,O]=d.useState(!1),[w,R]=d.useState(null),q=localStorage.getItem("accessToken");d.useEffect(()=>{q||ue(!0)},[q]),d.useEffect(()=>{b&&S()},[b]),d.useEffect(()=>{a&&v(a.orderStatus)},[a]);const S=async()=>{var r;try{$(!0),p(null);const s=await u.get(`/wallet/orderHistory/ordersByNo/${b}`);s.ok?(xe(s.data),v(s.data.orderStatus),(r=s.data)!=null&&r.hasMilestones&&je(s.data.id),h(null),N(null)):p("Failed to fetch order details")}catch(s){console.error("Error fetching order details:",s),p("An error occurred while fetching order details")}finally{$(!1)}},je=async r=>{if(r)try{O(!0);const s=await u.get(`/wallet/milestone/${r}`);s!=null&&s.ok&&Array.isArray(s.milestones)&&ye(s.milestones)}catch(s){console.error("Failed to fetch milestones:",s)}finally{O(!1)}},Ne=async r=>{var s,t;if(a!=null&&a.id&&!w){R(r.seq);try{const n=await u.post("/wallet/milestone/deliver",{orderId:a.id,milestoneSeq:r.seq});n!=null&&n.ok?(M.success(`Milestone ${r.seq} marked as delivered.`),await S()):M.error((n==null?void 0:n.error)||"Failed to mark milestone as delivered")}catch(n){M.error(((t=(s=n==null?void 0:n.response)==null?void 0:s.data)==null?void 0:t.error)||"Failed to mark milestone as delivered")}finally{R(null)}}},ke=async()=>{if(!(!a||!c||c===a.orderStatus))try{F(!0),h(null),N(null);const r={orderId:a.id,status:c},s=await u.post("/wallet/order/update-status",r);s.ok?(N(`Order status updated successfully to ${c.replace(/_/g," ")}`),await S(),f(!1)):h(s.message||"Failed to update order status")}catch(r){console.error("Error updating order status:",r),h("An error occurred while updating order status")}finally{F(!1)}},i=(r,s="INR")=>{const t=parseFloat(r)/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:s,minimumFractionDigits:2}).format(t)},C=(r,s=!1)=>{const t=new Date(r),n={year:"numeric",month:"long",day:"numeric"};return s&&(n.hour="2-digit",n.minute="2-digit",n.second="2-digit"),t.toLocaleDateString("en-US",n)},D=(r,s)=>{navigator.clipboard.writeText(r),A(s),setTimeout(()=>A(null),2e3)},x=(r,s="order")=>{const t="px-3 py-1 rounded-full text-sm font-medium inline-flex items-center gap-1";if(s==="order")switch(r){case"CONFIRMED":case"COMPLETED":return`${t} bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300`;case"PENDING_PAYMENT":return`${t} bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300`;case"CANCELLED":return`${t} bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300`;case"IN_PROGRESS":return`${t} bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300`;case"DELIVERED":return`${t} bg-indigo-100 dark:bg-indigo-900/30 text-indigo-800 dark:text-indigo-300`;case"DISPUTED":return`${t}
6 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300`;default:return`${t} bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300`}if(s==="payment")switch(r){case"PAID":return`${t} bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300`;case"UNPAID":return`${t} bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300`;case"PARTIALLY_PAID":return`${t} bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300`;default:return`${t} bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300`}if(s==="escrow")switch(r){case"HELD":return`${t} bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300`;case"RELEASED":return`${t} bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300`;case"PENDING_HOLD":return`${t} bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300`;case"REFUNDED":return`${t} bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300`;default:return`${t} bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300`}return`${t} bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300`},fe=()=>T.find(r=>r.value===c)||T[0];if(ge)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 py-8",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"animate-pulse space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-10 w-10 bg-gray-200 dark:bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-6 bg-gray-200 dark:bg-gray-700 rounded w-48"}),e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-32"})]})]}),[1,2,3].map(r=>e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 border border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-6 bg-gray-200 dark:bg-gray-700 rounded w-40"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-24"}),e.jsx("div",{className:"h-6 bg-gray-200 dark:bg-gray-700 rounded w-32"})]},s))})]})},r))]})})});if(y||!a)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md mx-auto px-4",children:[e.jsx("div",{className:"p-4 bg-red-100 dark:bg-red-900/20 rounded-full w-20 h-20 mx-auto mb-6 flex items-center justify-center",children:e.jsx(se,{className:"w-10 h-10 text-red-600 dark:text-red-400"})}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:y||"Order not found"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:y?"Please try again later":"The order you are looking for does not exist."}),e.jsxs("button",{onClick:()=>oe(-1),className:"px-6 py-3 bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white font-medium rounded-lg transition-all duration-300 flex items-center gap-2 mx-auto shadow-lg hover:shadow-xl",children:[e.jsx(E,{className:"w-4 h-4"}),"Go Back to Orders"]})]})});(parseFloat(a.breakdown.totalMinor)-parseFloat(a.breakdown.platformFeeMinor))/100;const _=fe();return e.jsxs("div",{className:"min-h-screen",children:[e.jsxs("div",{className:"container ",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-6 mb-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-3 bg-primary dark:bg-secondary rounded-xl shadow-lg",children:e.jsx(De,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900 dark:text-white",children:"Received Order Details"}),e.jsxs("p",{className:"text-gray-600 dark:text-gray-400",children:["Service request from ",a.user.firstName," ",a.user.lastName]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Order:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"font-mono font-bold text-gray-900 dark:text-white bg-white dark:bg-gray-800 px-3 py-1 rounded-lg border border-gray-200 dark:border-gray-700 shadow-sm",children:a.orderNo}),e.jsx("button",{onClick:()=>D(a.orderNo,"Order No"),className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Copy to clipboard",children:e.jsx(P,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})})]})]}),me==="Order No"&&e.jsxs("span",{className:"text-sm text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(Ee,{className:"w-4 h-4"}),"Copied"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs("span",{className:x(a.orderStatus,"order"),children:[a.orderStatus==="CONFIRMED"?e.jsx(I,{className:"w-4 h-4"}):e.jsx(m,{className:"w-4 h-4"}
6),a.orderStatus.replace(/_/g," ")]}),e.jsxs("span",{className:x(a.paymentStatus,"payment"),children:[e.jsx(Ge,{className:"w-4 h-4"}),a.paymentStatus]}),e.jsxs("span",{className:x(a.escrowStatus,"escrow"),children:[e.jsx(Ie,{className:"w-4 h-4"}),a.escrowStatus.replace(/_/g," ")]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:[e.jsx("div",{className:"bg-primary dark:bg-secondary  text-white rounded-xl p-6 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-blue-100 text-sm",children:"Total Amount"}),e.jsx("p",{className:"text-2xl font-bold mt-1",children:i(a.breakdown.totalMinor)})]}),e.jsx(Me,{className:"w-10 h-10 opacity-80"})]})}),e.jsx("div",{className:"bg-primary dark:bg-secondary  text-white rounded-xl p-6 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-green-100 text-sm",children:"Your Earnings"}),e.jsx("p",{className:"text-2xl font-bold mt-1",children:i((parseFloat((G=a==null?void 0:a.breakdown)==null?void 0:G.subtotalMinor)*(1-((l==null?void 0:l.commission)||0)/100)).toString())})]}),e.jsx(Pe,{className:"w-10 h-10 opacity-80"})]})}),e.jsx("div",{className:"bg-primary dark:bg-secondary  text-white rounded-xl p-6 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-purple-100 text-sm",children:"Escrow Status"}),e.jsx("p",{className:"text-xl font-bold mt-1",children:a.escrowStatus.replace(/_/g," ")})]}),e.jsx(te,{className:"w-10 h-10 opacity-80"})]})})]}),e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:" rounded-xl border border-blue-100 dark:border-blue-800 p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-900/50 text-primary dark:text-secondary rounded-lg",children:e.jsx(de,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Service Details"}),e.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-400",children:"Project requirements and specifications"})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"p-1.5 bg-blue-100 dark:bg-blue-900/30 rounded",children:e.jsx(ce,{className:"w-4 h-4 text-primary dark:text-secondary"})}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Service Title"})]}),e.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white pl-9",children:((V=(H=(B=a==null?void 0:a.order)==null?void 0:B.service)==null?void 0:H.serviceId)==null?void 0:V.serviceTitle)||"No title provided"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"p-1.5 bg-purple-100 dark:bg-purple-900/30 rounded",children:e.jsx(le,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Project Description"})]}),e.jsx("div",{className:"pl-9",children:e.jsx("div",{className:"bg-transparent dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4",children:e.jsx("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:((Q=(z=(Y=a==null?void 0:a.order)==null?void 0:Y.service)==null?void 0:z.serviceId)==null?void 0:Q.searchText)||"No description available"})})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"p-1.5 bg-green-100 dark:bg-green-900/30 rounded",children:e.jsx(Te,{className:"w-4 h-4 text-green-600 dark:text-green-400"})}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Comments"})]}),e.jsx("div",{className:"pl-9",children:e.jsx("div",{className:`rounded-lg border p-4 ${(Z=(W=a==null?void 0:a.order)==null?void 0:W.service)!=null&&Z.comments?"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700":"bg-yellow-50 dark:bg-yellow-900/10 border-yellow-200 dark:border-yellow-800"}`,children:e.jsx("p",{className:`leading-relaxed ${(K=(J=a==null?void 0:a.order)==null?void 0:J.service)!=null&&K.comments?"text-gray-700 dark:text-gray-300":"text-yellow-700 dark:text-yellow-300 italic"}`,children:((ee=(X=a==null?void 0:a.order)==null?void 0:X.service)==null?void 0:ee.comments)||"No comments added for this service"})})})]})]})}),(a==null?void 0:a.hasMilestones)&&e.jsxs("div",{className:"mb-8 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"Milestones"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Mark each milestone delivered. Client approval releases the escrow for that milestone."})]}),pe&&e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Loading…"})]}),e.jsx(_e,{milestones:be,highlightSeq:a==null?void 0:a.currentMilestoneSeq,renderAction:r=>r.status==="PAID"||r.status==="IN_PROGRESS"?e.jsx("button",{onClick:()=>
6Ne(r),disabled:w===r.seq,className:"px-3 py-1.5 text-xs font-semibold rounded-md bg-indigo-600 hover:bg-indigo-700 text-white disabled:opacity-60",children:w===r.seq?"Marking…":"Mark delivered"}):r.status==="DELIVERED"?e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Awaiting client approval"}):null})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2 space-y-8",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700",children:e.jsxs("nav",{className:"flex",children:[e.jsx("button",{onClick:()=>j("details"),className:`flex-1 py-4 px-6 text-center font-medium transition-colors ${o==="details"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(le,{className:"w-4 h-4"}),"Order Details"]})}),e.jsx("button",{onClick:()=>j("timeline"),className:`flex-1 py-4 px-6 text-center font-medium transition-colors ${o==="timeline"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(m,{className:"w-4 h-4"}),"Order Status"]})}),e.jsx("button",{onClick:()=>j("client"),className:`flex-1 py-4 px-6 text-center font-medium transition-colors ${o==="client"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),"Client Info"]})})]})}),e.jsxs("div",{className:"p-6",children:[o==="details"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Payment Breakdown"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Service Value"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:i(a.breakdown.subtotalMinor)})]}),a.couponRedeemed&&e.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-100 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Coupon Discount"}),e.jsx("span",{className:"text-xs bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 px-2 py-0.5 rounded-full",children:a.couponCode})]}),e.jsxs("span",{className:"font-medium text-green-600 dark:text-green-400",children:["-",i(a.breakdown.couponAmtMinor)]})]}),e.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-100 dark:border-gray-700",children:[e.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["Platform Fee (",a.breakdown.platformFeeType==="PERCENT"?a.breakdown.paltformFee+"%":"Fixed",")"]}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:i(a.breakdown.platformFeeMinor)})]}),e.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Tax (GST 18%)"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:i(a.breakdown.taxMinor)})]}),e.jsxs("div",{className:"flex justify-between items-center py-3",children:[e.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"Total Amount (User Paid)"}
6),e.jsx("span",{className:"text-xl font-bold text-blue-600 dark:text-blue-400",children:i(a.breakdown.totalMinor)})]}),e.jsxs("div",{className:"mt-6 p-4 bg-gradient-to-r from-green-50 to-emerald-50 dark:from-green-900/10 dark:to-emerald-900/10 rounded-lg border border-green-100 dark:border-green-800",children:[e.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Your Quate Value"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:i(a.breakdown.subtotalMinor)})]}),e.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-100 dark:border-gray-700",children:[e.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["GoPluto Commission (",(l==null?void 0:l.commission)||0,"%)"]}),e.jsxs("span",{className:"font-medium text-red-600 dark:text-red-400",children:["-",i((parseFloat(a.breakdown.subtotalMinor)*((l==null?void 0:l.commission)||0)/100).toString())]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-green-800 dark:text-green-300",children:"Your Estimated Earnings"}),e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"After platform fee deduction"})]}),e.jsx("span",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:i((parseFloat((ae=a==null?void 0:a.breakdown)==null?void 0:ae.subtotalMinor)*(1-((l==null?void 0:l.commission)||0)/100)).toString())})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:"Order Created"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:C(a.createdAt,!0)})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:"Last Updated"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:C(a.updatedAt,!0)})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:"Checkout ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded truncate flex-1",children:a.checkoutId}),e.jsx("button",{onClick:()=>D(a.checkoutId,"Checkout ID"),className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Copy to clipboard",children:e.jsx(P,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-1",children:"Transaction ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded truncate flex-1",children:a.latestTransactionId}),e.jsx("button",{onClick:()=>D(a.latestTransactionId,"Transaction ID"),className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Copy to clipboard",children:e.jsx(P,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})})]})]})]})]}),o==="timeline"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/10 dark:to-indigo-900/10 border border-blue-100 dark:border-blue-800 rounded-xl p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Update Project Status"}),e.jsxs("div",{className:"space-y-4",children:[U&&e.jsx("div",{className:"p-3 bg-green-100 dark:bg-green-900/30 border border-green-200 dark:border-green-800 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2 text-green-800 dark:text-green-300",children:[e.jsx(I,{className:"w-5 h-5"}),e.jsx("span",{className:"font-medium",children:U})]})}),L&&e.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2 text-red-800 dark:text-red-300",children:[e.jsx(se,{className:"w-5 h-5"}),e.jsx("span",{className:"font-medium",children:L})]})}),e.jsxs("div",{className:"relative",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Current Status"}),e.jsxs("button",{type:"button",onClick:()=>f(!k),className:`w-full px-4 py-3 ${_.color}
6 border border-transparent rounded-lg flex items-center justify-between font-medium transition-all duration-200 hover:shadow-md`,disabled:g,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[g?e.jsx(ie,{className:"w-5 h-5 animate-spin"}):e.jsx(m,{className:"w-5 h-5"}),e.jsx("span",{children:_.label})]}),e.jsx(Ae,{className:`w-5 h-5 transition-transform ${k?"rotate-180":""}`})]}),k&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",children:T.map(r=>e.jsxs("button",{type:"button",onClick:()=>{v(r.value),f(!1)},className:`w-full px-4 py-3 text-left flex items-center gap-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${c===r.value?r.color:"text-gray-700 dark:text-gray-300"}`,children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:r.color.includes("green")?"#10b981":r.color.includes("yellow")?"#f59e0b":r.color.includes("red")?"#ef4444":r.color.includes("purple")?"#8b5cf6":r.color.includes("blue")?"#3b82f6":r.color.includes("orange")?"#f97316":r.color.includes("indigo")?"#6366f1":"#6b7280"}}),r.label]},r.value))})]}),e.jsx("button",{onClick:ke,disabled:g||c===a.orderStatus,className:`w-full px-6 py-3 rounded-lg font-medium flex items-center justify-center gap-2 transition-all duration-300 ${g||c===a.orderStatus?"bg-gray-300 dark:bg-gray-700 cursor-not-allowed text-gray-500 dark:text-gray-400":"bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white shadow-lg hover:shadow-xl"}`,children:g?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-5 h-5 animate-spin"}),"Updating Status..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"w-5 h-5"}),c===a.orderStatus?"Status Already Updated":"Update Status"]})}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 text-center",children:"Updating status will notify the client about project progress"})]})]}),a.statusLog.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Status Timeline"}),e.jsx("div",{className:"space-y-6",children:a.statusLog.map((r,s)=>e.jsxs("div",{className:"relative pl-8 pb-6 last:pb-0",children:[s!==a.statusLog.length-1&&e.jsx("div",{className:"absolute left-[15px] top-6 bottom-0 w-0.5 bg-gray-200 dark:bg-gray-700"}),e.jsx("div",{className:`absolute left-0 top-1 w-7 h-7 rounded-full flex items-center justify-center ${r.action.includes("SUCCESS")?"bg-green-100 dark:bg-green-900/30 ring-2 ring-green-200 dark:ring-green-800":"bg-blue-100 dark:bg-blue-900/30 ring-2 ring-blue-200 dark:ring-blue-800"}`,children:r.action.includes("SUCCESS")?e.jsx(I,{className:"w-4 h-4 text-green-600 dark:text-green-400"}):e.jsx(m,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:r.action.replace(/_/g," ")}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:C(r.at,!0)})]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"By:"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.actor.type==="USER"?"Client":"System"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[r.to.orderStatus!==r.from.orderStatus&&e.jsxs("div",{className:"flex items-center gap-1 bg-gray-50 dark:bg-gray-800 px-3 py-1 rounded-lg",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Order:"}),e.jsx("span",{className:"text-gray-500 dark:text-gray-400 line-through",children:r.from.orderStatus}),e.jsx(E,{className:"w-3 h-3 text-gray-400"}),e.jsx("span",{className:x(r.to.orderStatus,"order"),children:r.to.orderStatus})]}),r.to.paymentStatus!==r.from.paymentStatus&&e.jsxs("div",{className:"flex items-center gap-1 bg-gray-50 dark:bg-gray-800 px-3 py-1 rounded-lg",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Payment:"}),e.jsx("span",{className:"text-gray-500 dark:text-gray-400 line-through",children:r.from.paymentStatus}),e.jsx(E,{className:"w-3 h-3 text-gray-400"}),e.jsx("span",{className:x(r.to.paymentStatus,"payment"),children:r.to.paymentStatus})]})]})]})]})]},s))})]})]}),o==="client"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 bg-gradient-to-r from-purple-500 to-pink-500 rounded-xl",children:e.jsx(ne,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:[a.user.firstName," ",a.user.lastName]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:a.user.email||"No email provided"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Phone Number"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a.user.mobileNo})]})]}),a.user.linkedinUrl&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"LinkedIn Profile"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"w-4 h-4 text-gray-400"}),e.jsx("a",{href:a.user.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-blue-600 dar
6k:text-blue-400 hover:underline truncate",children:"View Profile"})]})]}),a.billingDetails&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"md:col-span-2 space-y-2",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Billing Address"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Oe,{className:"w-4 h-4 text-gray-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:a.billingDetails.addressLine1}),e.jsxs("p",{className:"text-gray-600 dark:text-gray-400",children:[a.billingDetails.city,","," ",a.billingDetails.stateOrRegion]}),e.jsxs("p",{className:"text-gray-600 dark:text-gray-400",children:[a.billingDetails.country," -"," ",a.billingDetails.postalCode]})]})]})]}),a.billingDetails.companyName&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Company"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Re,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a.billingDetails.companyName})]})]})]})]})]})]})]})}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"p-3 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(te,{className:"w-6 h-6 text-purple-600 dark:text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"Escrow Status"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"Payment Security"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:`p-4 rounded-lg ${a.escrowStatus==="HELD"?"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800":"bg-gray-50 dark:bg-gray-700/50 border border-gray-200 dark:border-gray-700"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:"Status"}),e.jsx("span",{className:x(a.escrowStatus,"escrow"),children:a.escrowStatus.replace(/_/g," ")})]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a.escrowStatus==="HELD"?"Funds are securely held in escrow until service completion.":"Funds will be held upon payment confirmation."})]}),e.jsxs("div",{className:"p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-medium text-green-800 dark:text-green-300",children:"Release Amount"}),e.jsx("span",{className:"text-lg font-bold text-green-700 dark:text-green-300",children:i((parseFloat((re=a==null?void 0:a.breakdown)==null?void 0:re.subtotalMinor)*(1-((l==null?void 0:l.commission)||0)/100)).toString())})]}),e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"This amount will be released to you upon successful service delivery."})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 p-6",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white mb-6",children:"Quick Info"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(He,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Product"})]}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:a.product})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Quotation ID"})]}),e.jsxs("code",{className:"font-mono text-xs bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded",children:[a.quotationId.substring(0,8),"..."]})]}),e.jsx("div",{className:"pt-4 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Payment Gateway"}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:"Razorpay"})]})})]})]})]})]})]}),he&&e.jsx(qe,{})]})};export{Je as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.