import{E as e,L as t,c as n,ct as r,d as i,i as a,ot as o,t as s,u as c,w as l}from"./_plugin-vue_export-helper-Conii5fq.js";import{r as u}from"./router-CRKq-u_C.js";var d={name:`AddImageDialog`,emits:[`confirm`],setup(e,{emit:n}){let r=t(!1),i=t([]),a=t(null),o=()=>{r.value=!0,l()},s=()=>{r.value=!1},c=()=>{a.value&&n(`confirm`,`${a.value.id}`),s()},l=async()=>{try{i.value=(await u.get(`/image`)).data}catch(e){console.error(`Fehler beim Laden der Bilder:`,e),i.value=[]}};return{isOpen:r,images:i,selectedImage:a,openAddImageDialog:o,closeAddImageDialog:s,confirmAddImageConfiguration:c,selectImage:e=>{console.log(e),a.value=e}}}},f={key:0,class:`dialog-overlay`},p={class:`dialog-content`},m={class:`images-container`},h=[`onClick`],g=[`src`],_=[`title`],v={key:1},y={class:`button-container`};function b(t,s,u,d,b,x){return l(),i(`div`,null,[d.isOpen?(l(),i(`div`,f,[n(`div`,p,[s[2]||=n(`h3`,null,`Bild auswählen`,-1),n(`div`,m,[(l(!0),i(a,null,e(d.images,e=>(l(),i(`div`,{key:e.id,class:o([`image-block`,{selected:e.id===d.selectedImage?.id}]),onClick:t=>d.selectImage(e)},[n(`img`,{src:`/images/uploads/`+e.filename},null,8,g),e.description?(l(),i(`span`,{key:0,title:e.description},r(e.title),9,_)):(l(),i(`span`,v,r(e.title),1))],10,h))),128))]),n(`div`,y,[n(`button`,{onClick:s[0]||=(...e)=>d.confirmAddImageConfiguration&&d.confirmAddImageConfiguration(...e)},`Bestätigen`),n(`button`,{onClick:s[1]||=(...e)=>d.closeAddImageDialog&&d.closeAddImageDialog(...e)},`Schließen`)])])])):c(``,!0)])}var x=s(d,[[`render`,b],[`__scopeId`,`data-v-32c70499`]]);export{x as t};
//# sourceMappingURL=AddImageDialog-C4VdPcdq.js.map