module.exports=[596221,a=>{"use strict";let b=(0,a.i(170106).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["Loader2",0,b],596221)},862722,a=>{"use strict";let b=(0,a.i(170106).default)("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"}]]);a.s(["XCircle",0,b],862722)},435895,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(973549),e=a.i(759726),f=a.i(28915),g=a.i(816201),h=a.i(862722),i=a.i(596221),j=a.i(267900);a.s(["default",0,function(){let[a,k]=(0,c.useState)({}),{data:l,isLoading:m,refetch:n}=(0,e.useGetPendingFeeApprovalsQuery)(),[o,{isLoading:p}]=(0,e.useProcessFeeApprovalMutation)(),q=l?.data?.requests||[],r=async a=>{try{let b=await o({requestId:a,action:"approve"});b.data?.success?(f.toast.success("ফি অনুরোধ অনুমোদিত হয়েছে"),n()):f.toast.error(b.data?.message||"ব্যর্থ")}catch(a){f.toast.error("ব্যর্থ")}},s=async b=>{let c=a[b];if(!c?.trim())return void f.toast.error("অনুগ্রহ করে বাতিলের কারণ লিখুন");try{let a=await o({requestId:b,action:"reject",reason:c});a.data?.success&&(f.toast.success("ফি অনুরোধ বাতিল করা হয়েছে"),k(a=>{let c={...a};return delete c[b],c}),n())}catch(a){f.toast.error("ব্যর্থ")}};return(0,b.jsx)(d.default,{children:(0,b.jsxs)("div",{className:"space-y-6 px-4 py-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-xl font-bold text-gray-900 font-bangla",children:"সনদ ফি অনুমোদন"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-gray-500 font-bangla",children:"অফিসের ফি পরিবর্তনের অনুরোধ অনুমোদন করুন"})]}),m?(0,b.jsx)("div",{className:"flex justify-center py-12",children:(0,b.jsx)(i.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}):0===q.length?(0,b.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-8 text-center shadow-sm",children:[(0,b.jsx)(g.CheckCircle,{className:"mx-auto mb-3 h-12 w-12 text-gray-300"}),(0,b.jsx)("h3",{className:"text-base font-medium text-gray-700 font-bangla",children:"কোনো পেন্ডিং অনুরোধ নেই"}),(0,b.jsx)("p",{className:"mt-2 text-sm text-gray-500 font-bangla",children:"সকল ফি অনুরোধ পর্যালোচিত হয়েছে"})]}):(0,b.jsx)("div",{className:"space-y-4",children:q.map(c=>(0,b.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-5 shadow-sm",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(j.Building2,{className:"h-5 w-5 text-primary"}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"font-semibold text-gray-900",children:[c.office?.nameBn," (",c.office?.designation,")"]}),(0,b.jsxs)("p",{className:"text-sm text-gray-500",children:["ইউনিয়ন: ",c.office?.union]})]})]}),(0,b.jsxs)("div",{className:"mt-4 rounded-lg bg-gray-50 p-4",children:[(0,b.jsx)("h4",{className:"font-medium text-gray-900",children:c.sonodType?.nameBn}),(0,b.jsxs)("div",{className:"mt-2 grid gap-2 text-sm sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-gray-500",children:"বর্তমান ফি:"})," ",(0,b.jsxs)("span",{className:"font-medium",children:[c.sonodType?.defaultOfficeFee," টাকা"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-gray-500",children:"প্রস্তাবিত ফি:"})," ",(0,b.jsxs)("span",{className:"font-semibold text-primary",children:[c.officeFee," টাকা"]})]})]}),null!==c.platformFeeOverride&&(0,b.jsxs)("div",{className:"mt-2 text-sm",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"প্ল্যাটফর্ম ফি ওভাররাইড:"})," ",(0,b.jsxs)("span",{className:"font-medium",children:[c.platformFeeOverride," টাকা"]})]})]}),(0,b.jsxs)("div",{className:"mt-3 text-xs text-gray-400",children:["অনুরোধ: ",new Date(c.createdAt).toLocaleDateString("bn-BD")]})]}),(0,b.jsxs)("div",{className:"ml-4 flex flex-col gap-2",children:[(0,b.jsxs)("button",{onClick:()=>r(c.id),disabled:p,className:"flex items-center gap-2 rounded-lg bg-success px-4 py-2 text-sm font-medium text-white hover:bg-success/90 disabled:opacity-50",children:[p?(0,b.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(g.CheckCircle,{className:"h-4 w-4"}),"অনুমোদন"]}),(0,b.jsx)("div",{className:"text-center text-xs text-gray-400",children:"অথবা"})]})]}),"pending"===c.approvalStatus&&(0,b.jsxs)("div",{className:"mt-4 flex items-center gap-3 border-t pt-4",children:[(0,b.jsx)("input",{type:"text",value:a[c.id]||"",onChange:a=>k(b=>({...b,[c.id]:a.target.value})),placeholder:"বাতিলের কারণ লিখুন...",className:"flex-1 rounded-lg border border-gray-300 px-3 py-2 text-sm"}),(0,b.jsxs)("button",{onClick:()=>s(c.id),disabled:p||!a[c.id]?.trim(),className:"flex items-center gap-2 rounded-lg border border-red bg-red/10 px-4 py-2 text-sm font-medium text-red hover:bg-red/20 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(h.XCircle,{className:"h-4 w-4"}),"বাতিল"]})]})]},c.id))})]})})}])}];

//# sourceMappingURL=_0n7-r9o._.js.map