PageSourceSearch

https://indivites.com/assets/useAdminTemplateImages-B-D28IVP.js

js indivites.com collected 2026-09-24 14:45:21 UTC 1,248 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{r as t}from"./jsx-runtime-CHjTGAoW.js";import{O as n}from"./index-DXaDAQ0l.js";var r=e(t(),1),i=null,a=0,o=3e5,s=new Set;function c(e){return s.add(e),()=>s.delete(e)}function l(){s.forEach(e=>e())}function u(){let[e,t]=(0,r.useState)(i||[]),[s,l]=(0,r.useState)(!i),[u,d]=(0,r.useState)(null),f=(0,r.useCallback)(async(e=!1)=>{if(!e&&i&&Date.now()-a<o)return t(i),l(!1),i;try{l(!0);let{data:e,error:r}=await n.from(`admin_template_images`).select(`*`).eq(`is_active`,!0).order(`template_id`,{ascending:!0});if(r)throw r;let o=e||[];return i=o,a=Date.now(),t(o),o}catch(e){return console.error(`Error fetching admin template images:`,e),d(`Failed to fetch admin template images`),[]}finally{l(!1)}},[]),p=(0,r.useCallback)(t=>e.length&&e.find(e=>e.template_id===t&&e.image_type===`card`&&e.is_active)?.image_url||null,[e]),m=(0,r.useCallback)((t,n)=>e.length&&e.find(e=>e.template_id===t&&e.image_type===n&&e.is_active)?.image_url||null,[e]);return(0,r.useEffect)(()=>{f()},[f]),(0,r.useEffect)(()=>c(()=>{f(!0)}),[f]),{adminTemplateImages:e,loading:s,error:u,fetchAdminTemplateImages:f,getAdminTemplateCardImage:p,getAdminTemplateImage:m}}function d(){i=null,a=0,l()}export{u as n,d as t};

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.