PageSourceSearch

https://kolabo.co.id/assets/use-pics-BJME1GH1.js

js kolabo.co.id collected 2026-10-05 01:07:06 UTC 1,892 bytes, 1 lines download raw bytes

1import{r as m,j as t,b as x,aa as o,D as i,a5 as a}from"./index-CxTzo_i5.js";import{u as g}from"./useQuery-BujisQX_.js";import{u}from"./useMutation-nYJy1ouO.js";const h=m.forwardRef(({className:s,value:e,onChange:r,...c},l)=>{const d=e.startsWith("+62")?e.slice(3):e,p=f=>{const n=f.target.value.replace(/\D/g,"");r(n?`+62${n}`:"")};return t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground text-sm",children:"+62"}),t.jsx("input",{type:"tel",className:x("flex h-10 w-full rounded-md border border-input bg-background pl-12 pr-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:l,value:d,onChange:p,placeholder:"8xxxxxxxxxx",...c})]})});h.displayName="PhoneInput";function w(){return g({queryKey:["pics"],queryFn:async()=>{const{data:s,error:e}=await i.from("pics").select("*").order("name",{ascending:!0});if(e)throw e;return(s==null?void 0:s.map(r=>r.name))||[]}})}function P(){const s=o();return u({mutationFn:async e=>{const{error:r}=await i.from("pics").insert({name:e}).select().single();if(r)throw r.code==="23505"?new Error("PIC sudah ada"):r},onSuccess:()=>{s.invalidateQueries({queryKey:["pics"]})},onError:e=>{a({title:"Error",description:e.message,variant:"destructive"})}})}function C(){const s=o();return u({mutationFn:async e=>{const{error:r}=await i.from("pics").delete().eq("name",e);if(r)throw r},onSuccess:()=>{s.invalidateQueries({queryKey:["pics"]}),a({title:"Dihapus",description:"PIC berhasil dihapus"})},onError:e=>{a({title:"Error",description:`Gagal menghapus PIC: ${e.message}`,variant:"destructive"})}})}export{h as P,P as a,C as b,w as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.