import{g as p,m as c,l as g,o as r,c as u,b as a,t as f,e as v}from"./app-13978987.js";const V={class:"flex gap-x-2 items-center"},_=["href"],b=["src"],k=p({__name:"ImageInput",props:["label","modelValue"],emits:["update:modelValue"],setup(s,{emit:i}){const o=s,m=i,t=c("");g(()=>{typeof o.modelValue=="string"&&(t.value=o.modelValue)});const d=l=>{const e=new FileReader;e.readAsDataURL(l),e.onload=()=>{t.value=e.result},m("update:modelValue",l)};return(l,e)=>(r(),u("div",null,[a("label",null,f(s.label),1),a("div",V,[t.value&&typeof t.value=="string"?(r(),u("a",{key:0,href:t.value,target:"_blank"},[a("img",{src:t.value,onError:e[0]||(e[0]=n=>t.value="/assets/images/no-image-icon.png"),class:"h-8"},null,40,b)],8,_)):v("",!0),a("input",{type:"file",accept:"image/*",class:"input",onInput:e[1]||(e[1]=n=>d(n.target.files[0]))},null,32)])]))}});export{k as _};
