"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[63283],{63283:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(95155),i=s(12115),r=s(73321),n=s(55576),l=s(82181),o=s(2581),d=s(38992);function c({params:e}){let t=(0,r.useRouter)(),s=(0,i.use)(e),c=s?.id,[m,u]=(0,i.useState)(null),[h,x]=(0,i.useState)(!0);(0,i.useEffect)(()=>{c&&f()},[c]);let f=async()=>{try{x(!0);let e=await l.aN(c);u(e)}catch(e){console.error("Error fetching testimonial:",e),(0,o.Qg)(Object(e).message||"Failed to load testimonial"),t.push("/admin/testimonials")}finally{x(!1)}},p=async e=>{try{if(!c)throw Error("Testimonial ID is required");await l.fI(c,e),(0,o.Te)("Testimonial updated successfully!"),t.push("/admin/testimonials")}catch(e){throw console.error("Error updating testimonial:",e),(0,o.Qg)(Object(e).message||"Failed to update testimonial"),e}};return h?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,a.jsx)("div",{className:"text-center",children:(0,a.jsx)("div",{className:"text-lg text-[var(--muted-foreground)]",children:"Loading testimonial..."})})}):m?(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-[var(--foreground)]",children:"Edit Testimonial"}),(0,a.jsx)("p",{className:"text-[var(--muted-foreground)] mt-2",children:"Update testimonial details"})]}),(0,a.jsx)(n.S,{testimonial:m,onSubmit:p,onCancel:()=>{t.push("/admin/testimonials")}})]}):(0,a.jsx)(d.Z,{padding:"lg",children:(0,a.jsx)("div",{className:"text-center py-8",children:(0,a.jsx)("p",{className:"text-[var(--muted-foreground)]",children:"Testimonial not found"})})})}}}]);