Files
ntspi-app/public/build/assets/ClientPost-HujX0ISt.js
T
2024-10-14 14:56:10 +05:00

2 lines
2.3 KiB
JavaScript

import{_ as l}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as i,c as n,b as t,t as a,f as c}from"./app-lWrE2aWG.js";const d={name:"ClientPost",data(){return{}},methods:{textLimit(s,o){if(s.length>o){let e;return e=s.substring(0,o),e+"..."}return s}},props:{post:{type:Array}}},g={class:"group cursor-pointer"},h={class:"overflow-hidden rounded-md max-h-[250px] bg-gray-100 transition-all hover:scale-105 dark:bg-gray-800"},_=["href"],u=["src"],m={class:""},p={key:0,class:"flex gap-3"},x=["href"],f={class:"inline-block text-xs font-medium tracking-wider uppercase mt-5 text-blue-600"},y={key:1,class:"flex gap-3"},v={class:"text-lg font-semibold leading-snug tracking-tight mt-2 dark:text-white"},k=["href"],w={class:"duration-200 group-hover:text-gray-500"},b={class:""},C={class:"mt-2 line-clamp-3 text-sm text-gray-500 dark:text-gray-400"},B=["href"],L={class:"mt-3 flex items-center space-x-3 text-gray-500 dark:text-gray-400"},z={class:"flex items-center gap-3"},N={key:0,class:"truncate text-sm"},P={class:"truncate text-sm"};function T(s,o,e,V,j,r){return i(),n("div",g,[t("div",h,[t("a",{class:"relative block aspect-square",href:s.route("client.post.show",e.post.slug)},[t("img",{alt:"Thumbnail",loading:"lazy",decoding:"async","data-nimg":"fill",class:"object-cover transition-all",style:{position:"absolute",height:"100%",width:"100%",inset:"0px",color:"transparent"},sizes:"(max-width: 768px) 30vw, 33vw",src:e.post.preview?"/storage/"+e.post.preview:"/img/thumbnail-1.png"},null,8,u)],8,_)]),t("div",m,[t("div",null,[e.post.category?(i(),n("div",p,[t("a",{href:s.route("client.post.index",{"category[]":e.post.category.slug})},[t("span",f,a(e.post.category?e.post.category.title:"Новости"),1)],8,x)])):(i(),n("div",y,o[0]||(o[0]=[t("span",null,[t("span",{class:"inline-block text-xs font-medium tracking-wider uppercase mt-5 text-blue-600"}," Новости ")],-1)]))),t("h2",v,[t("a",{href:s.route("client.post.show",e.post.slug)},[t("span",w,a(e.post.title),1)],8,k)]),t("div",b,[t("p",C,[t("a",{href:s.route("client.post.show",e.post.slug)},a(e.post.preview_text),9,B)])]),t("div",L,[t("span",null,[t("div",z,[e.post?(i(),n("span",N,a(r.textLimit(e.post.authors[0],20)),1)):c("",!0)])]),o[1]||(o[1]=t("span",{class:"text-xs text-gray-300 dark:text-gray-600"},"•",-1)),t("span",P,a(e.post.created_post),1)])])])])}const D=l(d,[["render",T]]);export{D as C};