PageSourceSearch

https://vidacious.ai/assets/useCreatorFeed-D6jOiwFo.js

js vidacious.ai collected 2026-10-05 13:16:48 UTC 4,416 bytes, 1 lines download raw bytes

1import{r as i,j as r}from"./vendor-ui-Cp0o_ERz.js";import{n as N,C as x,V as C,m as g,h as k,aq as E,a as A,s as j}from"./index-U2qI6hth.js";import{s as R}from"./actorVolume-CW6fpi7u.js";import{A as $}from"./ActorShareButton-DTLCbmQs.js";import{b as q}from"./vendor-react-DblKtrgV.js";import{m as S}from"./vendor-motion-P7V77m0j.js";import{H as I}from"./heart-C1or41Sp.js";import{u as T}from"./vendor-query-Bv5ntzP6.js";const B=i.memo(function({actors:n,creatorSlug:o,creatorId:f,className:m,onActorClick:d}){const l=q(),{user:c}=N(),[t,v]=i.useState(null),u=i.useRef(null),w=i.useCallback((e,s)=>{if(e.stopPropagation(),!c){const p=encodeURIComponent(`/create?actorId=${s.id}`);l(`/auth?mode=signup&redirect=${p}`);return}l(`/create?actorId=${s.id}`)},[c,l]);i.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const _=(e,s)=>{s&&(u.current=setTimeout(()=>{v(e)},1e3))},y=()=>{u.current&&(clearTimeout(u.current),u.current=null),v(null)},b=e=>{if(d){d(e);return}const s=e.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"");l(`/actors/${s}-${e.id}`)};return n.length===0?r.jsxs(x,{variant:"elevated",className:"p-12 text-center",children:[r.jsx(C,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"No reels yet"})]}):r.jsx("div",{className:g("grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-4",m),children:n.map((e,s)=>{const p=t===e.id&&e.preview_video_url;return r.jsx(S.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:s*.03,duration:.2},children:r.jsxs(x,{variant:"elevated",className:"overflow-hidden group cursor-pointer hover:ring-2 hover:ring-primary/50 transition-all",onClick:()=>b(e),onMouseEnter:()=>_(e.id,!!e.preview_video_url),onMouseLeave:y,children:[r.jsxs("div",{className:"aspect-[3/4] relative overflow-hidden bg-secondary",children:[r.jsx("img",{src:e.image_url,alt:e.name,className:g("w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",p&&"opacity-0")}),p&&r.jsx(U,{src:e.preview_video_url,muted:!R(e.preview_video_url)}),r.jsxs("div",{className:"absolute top-2 right-2 flex flex-col gap-1.5 max-sm:opacity-100 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:[r.jsx("div",{onClick:h=>h.stopPropagation(),children:r.jsx($,{actorName:e.name,shareUrl:`${window.location.origin}/actors/${e.id}`,size:"icon",variant:"ghost",className:"rounded-full bg-black/60 hover:bg-black/80 backdrop-blur-sm h-9 w-9 text-white"})}),r.jsx("button",{onClick:h=>w(h,e),className:"w-9 h-9 rounded-full bg-primary hover:bg-primary/90 flex items-center justify-center shadow-lg transition-colors","aria-label":"Use this actor",children:r.jsx(k,{className:"w-4 h-4 text-primary-foreground"})})]}),r.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/70 to-transparent",children:r.jsxs("div",{className:"flex items-center gap-2 text-white text-xs",children:[(e.view_count??0)>0&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(E,{className:"w-3 h-3"}),(e.view_count??0).toLocaleString()]}),(e.reaction_count??0)>0&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(I,{className:"w-3 h-3"}),e.reaction_count]})]})})]}),r.jsxs(A,{className:"p-2 sm:p-3",children:[r.jsx("h3",{className:"font-medium text-sm truncate",children:e.name}),e.style&&r.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e.style})]})]})},e.id)})})});function U({src:a,muted:n}){const o=i.useRef(null);return i.useEffect(()=>{o.current&&o.current.play().catch(()=>{})},[]),r.jsx("video",{ref:o,src:a,className:"absolute inset-0 w-full h-full object-cover",muted:n,loop:!0,playsInline:!0})}function K({creatorId:a,enabled:n=!0,limit:o=50}){return T({queryKey:["creator-feed",a,o],queryFn:async()=>{if(!a)return[];const{data:f,error:m}=await j.from("actors").select("*").eq("creator_id",a).eq("is_active",!0).eq("is_test_mode",!1).is("owner_id",null).eq("is_derivative",!1).not("preview_video_url","is",null).order("created_at",{ascending:!1}).limit(o);if(m)throw m;const d=f?.map(t=>
1t.id)||[];if(d.length===0)return[];const{data:l}=await j.from("actor_reactions").select("actor_id").in("actor_id",d),c={};return l?.forEach(t=>{c[t.actor_id]=(c[t.actor_id]||0)+1}),(f||[]).map(t=>({...t,reaction_count:c[t.id]||0}))},enabled:n&&!!a,staleTime:30*1e3})}export{B as C,K 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.