import{d as p,i as y,o as c,e as m,a as e,t as s,u as a,F as g,h as k,b as u,w as l,g as h,f as w,y as b}from"./app-WJL2kJBE.js";import{_ as C}from"./DialogModal-B87MAZJT.js";import{_ as A}from"./DangerButton-BS8d3PUv.js";import{_ as B}from"./SecondaryButton-DT9RUAGX.js";const D={key:0,class:"mb-6"},F={class:"mb-1"},N={role:"list",class:"divide-y divide-gray-100 dark:divide-gray-800 rounded-md border border-gray-200 dark:border-gray-700"},V={class:"flex w-0 flex-1 items-center"},$={class:"ml-4 flex min-w-0 flex-1 gap-2"},M={class:"truncate font-medium"},T={class:"ml-4 flex-shrink-0 flex items-center gap-2"},j=["href"],z=["onClick"],E={class:"mt-2 text-red-500"},Y={__name:"Attachments",props:{attachments:{type:Array}},setup(_){const n=p(!1),r=p(null),{t}=y({}),x=()=>{b.delete(route("attachments.destroy",r.value.id),{onFinish:d})},v=i=>{n.value=!0,r.value=i},d=()=>{n.value=!1,r.value=null};return(i,f)=>_.attachments.length?(c(),m("div",D,[e("p",F,s(a(t)("Attachments")),1),e("ul",N,[(c(!0),m(g,null,k(_.attachments,o=>(c(),m("li",{key:o.id,class:"flex items-center justify-between py-4 pl-4 pr-5 text-sm leading-6"},[e("div",V,[f[0]||(f[0]=e("svg",{class:"h-5 w-5 flex-shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e("path",{"fill-rule":"evenodd",d:"M15.621 4.379a3 3 0 00-4.242 0l-7 7a3 3 0 004.241 4.243h.001l.497-.5a.75.75 0 011.064 1.057l-.498.501-.002.002a4.5 4.5 0 01-6.364-6.364l7-7a4.5 4.5 0 016.368 6.36l-3.455 3.553A2.625 2.625 0 119.52 9.52l3.45-3.451a.75.75 0 111.061 1.06l-3.45 3.451a1.125 1.125 0 001.587 1.595l3.454-3.553a3 3 0 000-4.242z","clip-rule":"evenodd"})],-1)),e("div",$,[e("span",M,s(o.title),1)])]),e("div",T,[e("a",{href:i.route("attachments.download",o.id),class:"font-medium text-blue-600 hover:text-blue-500"},s(a(t)("Download")),9,j),e("button",{type:"button",onClick:I=>v(o),class:"font-medium text-red-600 hover:text-red-500"},s(a(t)("Delete")),9,z)])]))),128))]),u(C,{show:n.value,onClose:d,maxWidth:"sm"},{title:l(()=>[h(s(a(t)("Delete {x}",{x:a(t)("attachment")})),1)]),content:l(()=>[e("p",null,s(a(t)("Please confirm that you would like to delete the record?")),1),e("p",E,s(a(t)("This action will delete the data permanently.")),1)]),footer:l(()=>[u(B,{onClick:d},{default:l(()=>[h(s(a(t)("Cancel")),1)]),_:1}),u(A,{onClick:x},{default:l(()=>[h(s(a(t)("Yes, delete")),1)]),_:1})]),_:1},8,["show"])])):w("",!0)}};export{Y as _};
