WIP PWA for Grain
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add grain-comment-list organism

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+54
+54
src/components/organisms/grain-comment-list.js
··· 1 + import { LitElement, html, css } from 'lit'; 2 + import '../molecules/grain-comment.js'; 3 + 4 + export class GrainCommentList extends LitElement { 5 + static properties = { 6 + comments: { type: Array }, 7 + totalCount: { type: Number } 8 + }; 9 + 10 + static styles = css` 11 + :host { 12 + display: block; 13 + padding: var(--space-sm) 0; 14 + } 15 + .header { 16 + font-size: var(--font-size-sm); 17 + color: var(--color-text-secondary); 18 + margin-bottom: var(--space-sm); 19 + } 20 + .no-comments { 21 + font-size: var(--font-size-sm); 22 + color: var(--color-text-secondary); 23 + font-style: italic; 24 + } 25 + `; 26 + 27 + constructor() { 28 + super(); 29 + this.comments = []; 30 + this.totalCount = 0; 31 + } 32 + 33 + render() { 34 + if (this.totalCount === 0) { 35 + return html`<p class="no-comments">No comments yet</p>`; 36 + } 37 + 38 + return html` 39 + ${this.totalCount > this.comments.length ? html` 40 + <div class="header">View all ${this.totalCount} comments</div> 41 + ` : ''} 42 + 43 + ${this.comments.map(comment => html` 44 + <grain-comment 45 + handle=${comment.actorHandle} 46 + text=${comment.text} 47 + createdAt=${comment.createdAt} 48 + ></grain-comment> 49 + `)} 50 + `; 51 + } 52 + } 53 + 54 + customElements.define('grain-comment-list', GrainCommentList);