| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/FormImage-a6549aaf.js |
import{r as p,o as t,c as l,a as s,t as c,b as h,n as x}from"./app-f1493ab2.js";const b={class:"flex items-center gap-x-3"},y=["src"],v={key:1,class:"h-20 w-20 text-gray-300",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},z=["disabled"],S={for:"file-upload",class:"cursor-pointer rounded-md bg-white px-2.5 py-1.5 text-sm text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"},_={key:0,class:"form-error text-[#b91c1c] text-xs"},V={__name:"FormImage",props:{modelValue:File,name:String,label:String,className:String,error:String,disabled:Boolean,imageUrl:String},emits:["update:modelValue"],setup(e,{emit:m}){const n=e,i=p(n.imageUrl),u=m,g=r=>{const a=r.target.files[0];if(a&&a.size>5242880)alert("File size exceeds the limit. Max allowed size: 5242880 bytes"),r.target.value=null;else{const d=new FileReader;d.onload=f=>{i.value=f.target.result},u("update:modelValue",a),d.readAsDataURL(a)}};return(r,o)=>(t(),l("div",{class:x(e.className)},[s("div",b,[i.value?(t(),l("img",{key:0,src:i.value,alt:"",class:"w-20 h-20 rounded-full dark:bg-gray-500"},null,8,y)):(t(),l("svg",v,o[0]||(o[0]=[s("path",{"fill-rule":"evenodd",d:"M18.685 19.097A9.723 9.723 0 0021.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 003.065 7.097A9.716 9.716 0 0012 21.75a9.716 9.716 0 006.685-2.653zm-12.54-1.285A7.486 7.486 0 0112 15a7.486 7.486 0 015.855 2.812A8.224 8.224 0 0112 20.25a8.224 8.224 0 01-5.855-2.438zM15.75 9a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z","clip-rule":"evenodd"},null,-1)]))),s("input",{type:"file",class:"sr-only",accept:".png, .jpg",id:"file-upload",onChange:g,disabled:e.disabled},null,40,z),s("label",S,c(n.label),1)]),e.error?(t(),l("div",_,c(e.error),1)):h("",!0)],2))}};export{V as _};