2 lines
1.9 KiB
JavaScript
2 lines
1.9 KiB
JavaScript
import{j as s,L as t,N as n}from"./vendor-BKmmeuxg.js";import{C as m,a as d,b as o,e as x}from"./card-D9_SJYq6.js";import{c as r,d as f}from"./utils-DxSsnXxD.js";import{A as u,a as j,b as h}from"./avatar-j28afJTV.js";const v=({blog:e,viewType:a="grid",className:l})=>s.jsxs(m,{className:r("group p-0",a==="list"&&"sm:flex sm:w-full sm:flex-row sm:justify-between",l),children:[s.jsx(d,{className:"p-0",children:s.jsx("div",{className:r("p-2 pb-0",a==="list"&&"pb-2"),children:s.jsx(t,{href:route("blogs.read",{slug:e.slug,id:e.id}),children:s.jsx("div",{className:r("relative h-[190px] overflow-hidden rounded-lg",a==="list"&&"sm:w-[260px]"),children:s.jsx("img",{src:e.thumbnail||"/assets/images/blank-image.jpg",alt:e.title,className:"h-full w-full object-cover transition-transform duration-300 hover:scale-105",onError:i=>{const c=i.target;c.src="/assets/images/blank-image.jpg"}})})})})}),s.jsxs("div",{className:r(a==="list"&&"flex w-[calc(100%-272px)] flex-col justify-between"),children:[s.jsx(o,{className:r("p-4",a==="list"&&"h-full"),children:s.jsx(t,{className:r("space-y-3",a==="list"&&"sm:flex sm:h-full sm:flex-col sm:justify-between sm:py-4"),href:route("blogs.read",{slug:e.slug,id:e.id}),children:s.jsx("p",{className:"hover:text-secondary-foreground font-semibold",children:e.title})})}),s.jsxs(x,{className:"flex w-full items-center justify-between gap-2 p-4 pt-0",children:[s.jsxs(u,{className:"h-9 w-9",children:[s.jsx(j,{src:e.user.photo||"",alt:e.user.name,className:"object-cover"}),s.jsx(h,{children:e.user.name[0]})]}),s.jsxs("div",{className:"w-full",children:[s.jsx("p",{className:"text-sm font-semibold",children:e.user.name}),s.jsxs("div",{className:"text-muted-foreground flex w-full items-center justify-between gap-2 text-sm",children:[s.jsx("span",{children:f(e.description)}),s.jsx("span",{children:n(new Date(e.created_at),{addSuffix:!0})})]})]})]})]})]});export{v as B};
|