Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/FormImage-5b2df4ab.js

import{r as h,o as t,c as l,a as s,t as d,b as p,n as _}from"./app-43851608.js";const x={class:"flex items-center gap-x-3"},b=["src"],y={key:1,class:"h-20 w-20 text-gray-300",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},v=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),z=[v],S=["accept","disabled"],w={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"},V={key:0,class:"form-error text-[#b91c1c] text-xs"},A={__name:"FormImage",props:{modelValue:File,name:String,label:String,className:String,error:String,disabled:Boolean,imageUrl:String},emits:["update:modelValue"],setup(e,{emit:c}){const o=e,i=h(o.imageUrl),m=c,u=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 n=new FileReader;n.onload=f=>{i.value=f.target.result},m("update:modelValue",a),n.readAsDataURL(a)}};return(r,g)=>(t(),l("div",{class:_(e.className)},[s("div",x,[i.value?(t(),l("img",{key:0,src:i.value,alt:"",class:"w-20 h-20 rounded-full dark:bg-gray-500"},null,8,b)):(t(),l("svg",y,z)),s("input",{type:"file",class:"sr-only",accept:".png, .jpg",id:"file-upload",onChange:u,disabled:e.disabled},null,40,S),s("label",w,d(o.label),1)]),e.error?(t(),l("div",V,d(e.error),1)):p("",!0)],2))}};export{A as _};