TheBird

PostCard.jsx

691 B · jsx · 17 lines

1import { postPoster, postRoute } from "../lib/feed.ts";2import { Life } from "./Life.jsx";34export function PostCard({ post, eager = false, now }) {5  return (6    <a className="card" href={postRoute(post.name)} aria-label={`Post ${post.name}, ${post.duration.toFixed(1)} seconds`}>7      <span className="shot">8        <img className="pixel" src={postPoster(post.name)} alt="" width={post.size || 540} height={post.size || 540} loading={eager ? "eager" : "lazy"} decoding="async" />9      </span>10      <h3 className="mono">{post.name}</h3>11      <span className="price">12        {`${post.duration.toFixed(1)}s · `}13        <Life born={post.at} now={now} />14      </span>15    </a>16  );17}