import{A as e,D as t,K as n,M as r,b as i,gt as a,j as o,jt as s,kt as c,ot as l,w as u,wt as d}from"./dist-B4ulKgpj.js";import{n as f}from"./usetoast-BF8L6V7u.js";import{t as p}from"./toast-CIOCHy8g.js";import{t as m}from"./button-DVjHqmFH.js";var h={class:`space-y-4`},g={class:`rounded-lg border border-[#d9e3ef] bg-[#f8fbff] p-4 text-sm`},_={class:`mt-1`},v={class:`mt-1`},y={class:`flex justify-end`},b=r({__name:`DeleteArticle`,props:{articleDetails:{}},setup(r){let b=r,x=f(),S=a(!1);function C(){S.value=!0,s.delete(`/article-management/${b.articleDetails.id}`,{onSuccess:()=>{S.value=!1,x.add({severity:`success`,summary:`Success`,detail:`Article deleted successfully`,life:2500}),setTimeout(()=>s.visit(`/article-management`),800)},onError:()=>{S.value=!1,x.add({severity:`error`,summary:`Error`,detail:`Failed to delete article`,life:2500})}})}return(a,s)=>(n(),t(i,null,[o(d(p)),u(`div`,h,[s[4]||=u(`p`,{class:`text-sm text-[#234e7a]`},` You are about to delete this article record. `,-1),u(`div`,g,[u(`p`,null,[s[0]||=u(`span`,{class:`font-semibold`},`Title:`,-1),e(` `+c(r.articleDetails.title||`-`),1)]),u(`p`,_,[s[1]||=u(`span`,{class:`font-semibold`},`Subtitle:`,-1),e(` `+c(r.articleDetails.subtitle||`-`),1)]),u(`p`,v,[s[2]||=u(`span`,{class:`font-semibold`},`Status:`,-1),e(` `+c(r.articleDetails.is_active?`Active`:`Inactive`),1)])]),u(`div`,y,[o(d(m),{severity:`danger`,loading:S.value,onClick:C},{default:l(()=>[...s[3]||=[u(`span`,null,[u(`i`,{class:`pi pi-trash`})],-1),u(`span`,null,` Delete Article`,-1)]]),_:1},8,[`loading`])])])],64))}});export{b as t};