/* ============================================================ GLASSGRID — POST CARD COMPONENT ⚠️ STRUCTURE IS FIXED. Do not modify class names. ⚠️ All visual changes through tokens/components.css only. ⚠️ Schema-validated post objects only. No raw HTML. ============================================================ */ 'use strict'; import { store, showToast } from '../lib/store.js'; import { api } from '../lib/api.js'; /** * Render a post card element. * @param {Object} post - Schema.Post validated object * @param {Object} user - Schema.User for the post author * @returns {HTMLElement} */ export function PostCard(post, user) { const liked = store.get('liked')?.[post.id] ?? false; const saved = store.get('saved')?.[post.id] ?? false; const config = store.get('config') ?? {}; const features = store.get('features') ?? {}; const el = document.createElement('article'); el.className = 'post-card glass animate-fadeInUp'; el.dataset.postId = post.id; el.setAttribute('role', 'article'); el.innerHTML = `
${escHtml(user.username)}${escHtml(post.caption)}