import { Skeleton } from '@/components/ui/skeleton' import { cn } from '@/lib/utils' import { TNip66RelayInfo } from '@/types' import { HTMLProps } from 'react' import { useTranslation } from 'react-i18next' import RelayBadges from '../RelayBadges' import RelayIcon from '../RelayIcon' import SaveRelayDropdownMenu from '../SaveRelayDropdownMenu' import { SimpleUserAvatar } from '../UserAvatar' export default function RelaySimpleInfo({ relayInfo, hideBadge = false, className, ...props }: HTMLProps & { relayInfo?: TNip66RelayInfo & { users?: string[] } hideBadge?: boolean }) { const { t } = useTranslation() return (
{relayInfo?.name || relayInfo?.shortUrl}
{relayInfo?.name && (
{relayInfo?.shortUrl}
)}
{relayInfo && }
{!hideBadge && relayInfo && } {!!relayInfo?.description &&
{relayInfo.description}
} {!!relayInfo?.users?.length && (
{t('Favorited by')}
{relayInfo.users.slice(0, 10).map((user) => ( ))} {relayInfo.users.length > 10 && (
+{relayInfo.users.length - 10}
)}
)}
) } export function RelaySimpleInfoSkeleton() { return (
) }