diff --git a/src/features/explore/components/follow-packs.tsx b/src/features/explore/components/follow-packs.tsx new file mode 100644 index 000000000..e3eb92aa7 --- /dev/null +++ b/src/features/explore/components/follow-packs.tsx @@ -0,0 +1,581 @@ +import arrowIcon from '@tabler/icons/outline/chevron-down.svg'; +import plusIcon from '@tabler/icons/outline/plus.svg'; +import groupIcon from '@tabler/icons/outline/users.svg'; +import React, { useEffect, useState, useRef } from 'react'; +import { FormattedMessage, useIntl } from 'react-intl'; + +import Avatar from 'soapbox/components/ui/avatar.tsx'; +import { Card, CardBody } from 'soapbox/components/ui/card.tsx'; +import HStack from 'soapbox/components/ui/hstack.tsx'; +import IconButton from 'soapbox/components/ui/icon-button.tsx'; +import Spinner from 'soapbox/components/ui/spinner.tsx'; +import Stack from 'soapbox/components/ui/stack.tsx'; +import SvgIcon from 'soapbox/components/ui/svg-icon.tsx'; +import Text from 'soapbox/components/ui/text.tsx'; + + +// Define standard relays for production +const STANDARD_RELAYS = [ + 'wss://relay.damus.io', + 'wss://relay.nostr.band', + 'wss://nos.lol', + 'wss://nostr.wine', + 'wss://relay.nostr.org', +]; + +interface FollowPackUser { + pubkey: string; + picture?: string; + displayName?: string; + name?: string; + nip05?: string; + loaded?: boolean; +} + +interface FollowPack { + id: string; + pubkey: string; + title: string; + description?: string; + image?: string; + created_at: number; + url?: string; + users: FollowPackUser[]; +} + +const ImageWithFallback: React.FC<{ src?: string; alt: string; className?: string }> = ({ + src, + alt, + className = '', +}) => { + const [isImgLoaded, setIsImgLoaded] = useState(false); + const [imgError, setImgError] = useState(false); + + // Default gradient background + const gradientStyle = { + background: 'linear-gradient(45deg, #6364ff, #563acc)', + }; + + const handleError = () => { + setImgError(true); + setIsImgLoaded(true); + }; + + const handleLoad = () => { + setIsImgLoaded(true); + }; + + return ( +