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