import { TrendsLink } from 'pl-api'; import React from 'react'; import { getTextDirection } from 'pl-fe/utils/rtl'; import Blurhash from './blurhash'; import { accountsCountRenderer } from './hashtag'; import { HStack, Icon, Stack, Text } from './ui'; interface ITrendingLink { trendingLink: TrendsLink; } const TrendingLink: React.FC = ({ trendingLink }) => { const count = Number(trendingLink.history?.[0]?.accounts); const direction = getTextDirection(trendingLink.title + trendingLink.description); let media; if (trendingLink.image) { media = (
{trendingLink.blurhash && ( )} {trendingLink.image_description
); } return ( {media} {trendingLink.title} {trendingLink.description && {trendingLink.description}} {trendingLink.provider_name} {!!count && accountsCountRenderer(count)} ); }; export default TrendingLink;