Files
appco_dist/.output/public/_nuxt/VkUzHMTo.js
T
2025-08-24 13:00:31 +03:30

2 lines
1.6 KiB
JavaScript

import{d as h,k as i,ap as k,y as n,z as c,aa as d,A as s,I as l,ar as S,a7 as u,bA as w}from"./BYv1load.js";import{i as p}from"./11yttv_H.js";const C=["id","value"],_=["for"],x=h({__name:"StoriesComponent",props:{story:{},selectedStory:{}},emits:["update:selectedStory"],setup(y,{emit:m}){const t=y,b=m,a=i(()=>t.selectedStory?.includes(t.story?.id)),r=i({get(){return t.selectedStory},set(e){b("update:selectedStory",e)}});function v(){const e=r.value?.findIndex(o=>o===t.story.id);e===-1?r.value?.push(t.story.id):r.value?.splice(e,1)}return(e,o)=>{const f=k("lazy");return c(),n("div",{class:"w-full h-full aspect-[2/3] relative",onClick:v},[d(s("img",{class:u(["w-full h-full object-cover aspect-[2/3]",a.value&&"bg-gray-500 opacity-50"])},null,2),[[f,{src:l(S)(e.story?.media_url),loading:l(p),error:l(p)}]]),d(s("input",{type:"checkbox",id:`story-${e.story.id}`,value:e.story,"onUpdate:modelValue":o[0]||(o[0]=g=>r.value=g),class:"absolute opacity-0 w-full h-full peer"},null,8,C),[[w,r.value]]),s("label",{for:`story-${e.story.id}`,class:"absolute bottom-2 right-2 w-5 h-5 rounded border-1 border-black cursor-pointer transition-all group-hover:ring-2 group-hover:ring-blue-400 peer-checked:bg-black peer-checked:border-black"},[(c(),n("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:u(["w-18px h-18px text-white bg-black transition-opacity",a.value?"peer-checked:opacity-100":"opacity-0"])},o[1]||(o[1]=[s("path",{d:"M5 12l5 5L20 7"},null,-1)]),2))],8,_)])}}}),j=Object.assign(x,{__name:"StoriesComponent"});export{j as S};