PageSourceSearch

https://www.bagchee.com/static/js/3335.7bedaa81.chunk.js

js bagchee.com collected 2026-10-02 11:16:48 UTC 4,654 bytes, 3 lines download raw bytes

1/*! For license information please see 3335.7bedaa81.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[3335],{2024(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3335(e,t,a){a.r(t),a.d(t,{default:()=>x});var s=a(9379),r=a(5043),n=a(7874),d=a(2024),c=a(6210),o=a(4805),i=a(614),l=a(3046),m=a(2339),p=a(579);const x=()=>{const e=(0,n.Zp)(),{id:t}=(0,n.g)(),[a,x]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!0),[b,y]=(0,r.useState)({name:""});(0,r.useEffect)(()=>{(async()=>{try{const e="https://www.bagchee.com/api",a=await l.A.get("".concat(e,"/order-status/get/").concat(t));a.data.status&&y({name:a.data.data.name})}catch(a){console.error("Fetch error:",a),m.Ay.error("Failed to load order status details"),e("/admin/order-status")}finally{h(!1)}})()},[t,e]);const g=async(a,s)=>{if(a.preventDefault(),!b.name.trim())return m.Ay.error("Name is required!");x(!0);const r=m.Ay.loading("Updating order status...");try{const a="https://www.bagchee.com/api";(await l.A.patch("".concat(a,"/order-status/update/").concat(t),b)).data.status&&(m.Ay.success("Order Status updated successfully! \ud83d\udd16",{id:r}),"back"===s&&e("/admin/order-status"))}catch(c){var n,d;m.Ay.error((null===(n=c.response)||void 0===n||null===(d=n.data)||void 0===d?void 0:d.msg)||"Failed to update",{id:r})}finally{x(!1)}};return u?(0,p.jsx)("div",{className:"min-h-screen bg-cream-50 flex items-center justify-center",children:(0,p.jsx)(d.A,{className:"animate-spin text-primary",size:40})}):(0,p.jsxs)("div",{className:"bg-cream-50 min-h-screen font-body text-text-main pb-10",children:[(0,p.jsx)("div",{className:"bg-primary sticky top-0 z-50 px-6 py-3 shadow-md flex items-center justify-between",children:(0,p.jsx)("h1",{className:"text-lg font-bold text-white uppercase tracking-slick font-display",children:"Edit Order Status"})}),(0,p.jsx)("div",{className:"max-w-6xl mx-auto p-6 mt-4",children:(0,p.jsxs)("form",{className:"bg-white rounded border border-cream-200 shadow-sm overflow-hidden",children:[(0,p.jsx)("div",{className:"bg-cream-100 px-6 py-2 border-b border-cream-200",children:(0,p.jsx)("h2",{className:"text-[11px] font-bold uppercase tracking-wider font-montserrat text-text-muted",children:"Order Status Information"})}),(0,p.jsxs)("div",{className:"p-8 space-y-6",children:[(0,p.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center",children:[(0,p.jsx)("label",{className:"col-span-3 text-right text-[11px] font-bold text-text-muted uppercase font-montserrat pt-2",children:"Name"}),(0,p.jsx)("div",{className:"col-span-9",children:(0,p.jsx)("input",{type:"text",name:"name",value:b.name,onChange:e=>{y((0,s.A)((0,s.A)({},b),{},{[e.target.name]:e.target.value}))},className:"w-full border border-gray-300 rounded px-4 py-2 text-[13px] outline-none transition-all focus:border-primary bg-white focus:ring-1 focus:ring-primary/20 font-body text-text-main",placeholder:"Enter status name"})})]}),(0,p.jsxs)("div",{className:"flex justify-center items-center gap-3 pt-8 border-t mt-10 font-montserrat",children:[(0,p.jsxs)("button",{type:"button",onClick:e=>g(e,"stay"),disabled:a,className:"bg-white border border-gray-300 hover:bg-gray-50 text-text-main px-6 py-2 rounded font-bold text-[11px] uppercase transition-all flex items-center gap-2 shadow-sm",children:[a?(0,p.jsx)(d.A,{size:14,className:"animate-spin"}):(0,p.jsx)(c.A,{size:16,className:"text-green-600"}),(0,p.jsx)("span",{className:"font-bold",children:"Update"})]}),(0,p.jsxs)("button",{type:"button",onClick:e=>g(e,"back"),disabled:a,className:"bg-white border border-gray-300 hover:bg-gray-50 text-text-main px-6 py-2 rounded font-bold text-[11px] uppercase transition-all flex items-center gap-2 shadow-sm",children:[(0,p.jsx)(o.A,{size:16,className:"text-primary"}),(0,p.jsx)("span",{className:"font-bold",children:"Update and go back"})]}),(0,p.jsxs)("button",{type:"button",onClick:()=>e("/admin/order-status"),className:"bg-white border border-gray-300 hover:bg-gray-50 text-text-main px-6 py-2 rounded font-bold text-[11px] uppercase transition-all flex items-center gap-2 shadow-sm",children:[(0,p.jsx)(i.A,{size:16,className:"text-red-600"}),(0,p.jsx)("span",{className:"font-bold",children:"Cancel"})]})]})]})]})})]})}},4805(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},6210(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}}]);
3//# sourceMappingURL=3335.7bedaa81.chunk.js.map

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.