import {View} from 'react-native' import {Trans} from '@lingui/macro' import {isWeb} from '#/platform/detection' import {useTrendingSettings} from '#/state/preferences/trending' import { DEFAULT_LIMIT as TRENDING_TOPICS_COUNT, useTrendingTopics, } from '#/state/queries/trending/useTrendingTopics' import {useTrendingConfig} from '#/state/trending-config' import {atoms as a, tokens, useGutters, useTheme} from '#/alf' import {GradientFill} from '#/components/GradientFill' import {Trending2_Stroke2_Corner2_Rounded as Trending} from '#/components/icons/Trending2' import { TrendingTopic, TrendingTopicLink, TrendingTopicSkeleton, } from '#/components/TrendingTopics' import {Text} from '#/components/Typography' export function ExploreTrendingTopics() { const {enabled} = useTrendingConfig() const {trendingDisabled} = useTrendingSettings() return enabled && !trendingDisabled ? : null } function Inner() { const t = useTheme() const gutters = useGutters([0, 'compact']) const {data: trending, error, isLoading} = useTrendingTopics() const noTopics = !isLoading && !error && !trending?.topics?.length return error || noTopics ? null : ( <> Trending BETA What people are posting about. {isLoading ? ( Array(TRENDING_TOPICS_COUNT) .fill(0) .map((_, i) => ) ) : !trending?.topics ? null : ( <> {trending.topics.map(topic => ( {({hovered}) => ( )} ))} )} ) }