2 lines
1.9 KiB
JavaScript
2 lines
1.9 KiB
JavaScript
import{_ as z,l as y}from"./4eaJp2B7.js";import{d as B,u as j,G as T,r as p,a5 as q,o as V,ak as x,y as o,z as a,a4 as D,H as e,S as i,T as n,a2 as c,A as t,a7 as k,F,a3 as G,a8 as I,al as L}from"./DE-gAEY9.js";import{u as M}from"./DtF65ZAt.js";const N={class:"w-full grid grid-cols-3 gap-2px"},R=["onClick"],$={key:0,class:"w-full h-full object-cover",alt:"Post Image"},A={key:1,class:"relative w-full h-full"},E=["src"],H=["src"],W=B({__name:"SavedList",setup(O){const b=j();T();const r=M(),w=p({}),u=p();return q(u,([{isIntersecting:s}])=>{s&&setTimeout(()=>{r.loadPosts()},100)}),V(()=>{r.loadPosts()}),(s,d)=>{var f;const S=z,P=x("lazy");return a(),o("div",{class:D(["flex flex-col gap-2 min-h-50vh",((f=e(r).savedPosts)==null?void 0:f.length)>0?"":"justify-center"])},[("loading"in s?s.loading:e(n))?i("",!0):(a(),o(c,{key:0},[t("div",N,[(a(!0),o(c,null,G(e(r).savedPosts,(l,C)=>{var v,g,m,_,h;return a(),o("div",{key:C,class:"w-full aspect-square relative",onClick:U=>e(b).push({name:"saved-posts",query:{target:l.id}})},[(v=l.files)!=null&&v.length?(a(),o(c,{key:0},[((g=l.files[0])==null?void 0:g.type)==="image"?k((a(),o("img",$,null,512)),[[P,{src:e(L)(l.files[0].url),loading:e(y),error:e(y)}]]):((m=l.files[0])==null?void 0:m.type)==="video"?(a(),o("div",A,[t("video",{ref_for:!0,ref:"videoRefs",src:(_=l.files[0])==null?void 0:_.url,class:"hidden"},null,8,E),t("img",{src:w.value[(h=l.files[0])==null?void 0:h.url],class:"w-full h-full object-cover",alt:"Video Thumbnail"},null,8,H),d[0]||(d[0]=t("div",{class:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-30"},[t("svg",{class:"w-12 h-12 text-white",fill:"currentColor",viewBox:"0 0 24 24"},[t("path",{d:"M8 5v14l11-7z"})])],-1))])):i("",!0)],64)):i("",!0)],8,R)}),128))]),k(t("div",{ref_key:"observer",ref:u,class:"w-full opacity-0 relative"}," load ",512),[[I,!("loading"in s?s.loading:e(n))]]),("loading"in s?s.loading:e(n))?(a(),F(S,{key:0})):i("",!0)],64))],2)}}});export{W as _};
|