diff --git a/src/components/FollowPackDetailContent.tsx b/src/components/FollowPackDetailContent.tsx index 79ebd450..daf8104c 100644 --- a/src/components/FollowPackDetailContent.tsx +++ b/src/components/FollowPackDetailContent.tsx @@ -1,6 +1,6 @@ import { useMemo, useState, useCallback } from 'react'; import { Link, useNavigate } from 'react-router-dom'; -import { Users, UserPlus, Check, Loader2, Copy } from 'lucide-react'; +import { Users, UserPlus, Check, Loader2, Copy, Rss } from 'lucide-react'; import { nip19 } from 'nostr-tools'; import type { NostrEvent, NostrMetadata } from '@nostrify/nostrify'; @@ -9,12 +9,17 @@ import { getAvatarShape } from '@/lib/avatarShape'; import { Button } from '@/components/ui/button'; import { Skeleton } from '@/components/ui/skeleton'; import { Badge } from '@/components/ui/badge'; +import { NoteCard } from '@/components/NoteCard'; +import { TabButton } from '@/components/TabButton'; import { useToast } from '@/hooks/useToast'; import { useAuthor } from '@/hooks/useAuthor'; import { useAuthors } from '@/hooks/useAuthors'; import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useFollowList, useFollowActions } from '@/hooks/useFollowActions'; import { useNostrPublish } from '@/hooks/useNostrPublish'; +import { useStreamPosts } from '@/hooks/useStreamPosts'; +import { useMuteList } from '@/hooks/useMuteList'; +import { isEventMuted } from '@/lib/muteHelpers'; import { useNostr } from '@nostrify/react'; import { genUserName } from '@/lib/genUserName'; import { VerifiedNip05Text } from '@/components/Nip05Badge'; @@ -30,6 +35,113 @@ function parsePackEvent(event: NostrEvent) { return { title, description, image, pubkeys }; } +type Tab = 'feed' | 'members'; + +// ─── Feed Tab ───────────────────────────────────────────────────────────────── + +function PackFeedTab({ pubkeys }: { pubkeys: string[] }) { + const { muteItems } = useMuteList(); + + const { posts, isLoading } = useStreamPosts('', { + includeReplies: false, + mediaType: 'all', + authorPubkeys: pubkeys, + }); + + const filteredPosts = useMemo(() => { + if (muteItems.length === 0) return posts; + return posts.filter((e) => !isEventMuted(e, muteItems)); + }, [posts, muteItems]); + + if (pubkeys.length === 0) { + return ( +
No members in this pack yet.
+