PageSourceSearch

https://www.bagchee.com/static/js/7993.716f04fb.chunk.js

js bagchee.com collected 2026-10-02 11:17:40 UTC 5,068 bytes, 3 lines download raw bytes

1/*! For license information please see 7993.716f04fb.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[7993],{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"}]])},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"}]])},7993(e,t,a){a.r(t),a.d(t,{default:()=>u});var s=a(9379),n=a(5043),r=a(7874),i=a(2024),c=a(6210),l=a(4805),d=a(614),o=a(8555),m=a.n(o),p=a(3046),x=a(2339),h=a(579);const u=()=>{const e=(0,r.Zp)(),[t,a]=((0,n.useRef)(null),(0,n.useState)(!1)),[o,u]=(0,n.useState)(!0),[g,b]=(0,n.useState)({title:"",meta_title:"",meta_description:"",meta_keywords:""}),[y,f]=(0,n.useState)("");(0,n.useEffect)(()=>{(async()=>{try{const e="https://www.bagchee.com/api",t=await p.A.get("".concat(e,"/testimonials/get"));if(t.data.status&&t.data.data){const e=t.data.data;b({title:e.title||"",meta_title:e.meta_title||"",meta_description:e.meta_description||"",meta_keywords:e.meta_keywords||""}),f(e.pageContent||"")}}catch(e){console.error("Fetch Error")}finally{u(!1)}})()},[]);const w=e=>{b((0,s.A)((0,s.A)({},g),{},{[e.target.name]:e.target.value}))},j=async(t,n)=>{t.preventDefault(),a(!0);const r=x.Ay.loading("Updating Testimonials...");try{const t=(0,s.A)((0,s.A)({},g),{},{pageContent:y}),a="https://www.bagchee.com/api";(await p.A.patch("".concat(a,"/testimonials/update"),t)).data.status&&(x.Ay.success("Testimonials updated successfully!",{id:r}),"back"===n&&e("/admin/pages"))}catch(i){x.Ay.error("Failed to update",{id:r})}finally{a(!1)}},N=(0,n.useMemo)(()=>({readonly:!1,height:450,theme:"default",placeholder:"Write testimonials content...",buttons:["source","|","bold","italic","underline","|","font","fontsize","brush","align","undo","redo"]}),[]),v="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",k="col-span-12 md:col-span-2 text-left md:text-right text-[11px] font-bold text-text-muted uppercase font-montserrat pt-2";return o?(0,h.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-cream-50",children:(0,h.jsx)(i.A,{className:"animate-spin text-primary",size:32})}):(0,h.jsxs)("div",{className:"bg-cream-50 min-h-screen font-body text-text-main pb-10",children:[(0,h.jsx)("div",{className:"bg-primary px-6 py-3 shadow-md text-white font-display font-bold uppercase tracking-widest",children:"Edit Testimonials"}),(0,h.jsx)("div",{className:"max-w-[1400px] mx-auto p-4 md:p-6 mt-2",children:(0,h.jsxs)("form",{className:"bg-white rounded border border-cream-200 shadow-sm overflow-hidden p-8 space-y-8",children:[(0,h.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center",children:[(0,h.jsx)("label",{className:k,children:"Title"}),(0,h.jsx)("div",{className:"col-span-12 md:col-span-10",children:(0,h.jsx)("input",{name:"title",value:g.title,onChange:w,className:v})})]}),(0,h.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-start",children:[(0,h.jsx)("label",{className:k,children:"Page content"}),(0,h.jsx)("div",{className:"col-span-12 md:col-span-10 border rounded overflow-hidden shadow-inner",children:(0,h.jsx)(m(),{value:y,config:N,onBlur:e=>f(e)})})]}),(0,h.jsx)("div",{className:"space-y-4 pt-4 border-t border-cream-100",children:["meta_title","meta_description","meta_keywords"].map(e=>(0,h.jsxs)("div",{className:"grid grid-cols-12 gap-4 items-center",children:[(0,h.jsx)("label",{className:k,children:e.replace("_"," ")}),(0,h.jsx)("div",{className:"col-span-12 md:col-span-10",children:(0,h.jsx)("input",{name:e,value:g[e],onChange:w,className:v})})]},e))}),(0,h.jsxs)("div",{className:"flex justify-center items-center gap-4 pt-8 border-t mt-10",children:[(0,h.jsxs)("button",{type:"button",onClick:e=>j(e,"stay"),className:"bg-white border border-gray-300 hover:bg-gray-50 text-text-main px-8 py-2.5 rounded font-bold text-[11px] uppercase transition-all flex items-center gap-2 shadow-sm",children:[t?(0,h.jsx)(i.A,{size:14,className:"animate-spin"}):(0,h.jsx)(c.A,{size:16,className:"text-green-600"}),"Update changes"]}),(0,h.jsxs)("button",{type:"button",onClick:e=>j(e,"back"),className:"bg-white border border-gray-300 hover:bg-gray-50 text-text-main px-8 py-2.5 rounded font-bold text-[11px] uppercase transition-all flex items-center gap-2 shadow-sm",children:[(0,h.jsx)(l.A,{size:16,className:"text-primary"})," Update and go back to list"]}),(0,h.jsxs)("button",{type:"button",onClick:()=>e("/admin/pages"),className:"bg-white border border-gray-300 hover:bg-red-50 text-text-main px-8 py-2.5 rounded font-bold text-[11px] uppercase transition-all flex items-center gap-2 shadow-sm",children:[(0,h.jsx)(d.A,{size:16,className:"text-red-600"})," Cancel"]})]})]})})]})}}}]);
3//# sourceMappingURL=7993.716f04fb.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.