feat: add feed
This commit is contained in:
@@ -30,13 +30,18 @@ import { UserAvatar } from "@/components/ui/user-avatar";
|
||||
import { timeAgo } from "@/lib/time";
|
||||
import { PostActionsFooter } from "./post-actions-footer";
|
||||
import { PostCardMenu } from "./post-card-menu";
|
||||
import { FeedFollowButton } from "./feed-follow-button";
|
||||
|
||||
export function PostCard({
|
||||
post,
|
||||
onDelete,
|
||||
enableFollow = false,
|
||||
}: {
|
||||
post: Post;
|
||||
onDelete?: (id: string) => void;
|
||||
/** Home-feed only: show a Follow / Follow back button in the header for
|
||||
* authors the viewer doesn't already follow. */
|
||||
enableFollow?: boolean;
|
||||
}) {
|
||||
const sourceHref =
|
||||
hasHighlight(post.source_url) || !post.caption
|
||||
@@ -94,6 +99,12 @@ export function PostCard({
|
||||
{timeAgo(post.created_at)}
|
||||
</p>
|
||||
</div>
|
||||
{enableFollow && authorHandle && !post.viewer_follows_author ? (
|
||||
<FeedFollowButton
|
||||
handle={authorHandle}
|
||||
followsYou={!!post.author_follows_viewer}
|
||||
/>
|
||||
) : null}
|
||||
<PostCardMenu post={post} onDelete={onDelete} />
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user