import { useState } from 'react'; import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import Plebbit from '@plebbit/plebbit-js'; import { useDefaultSubplebbitsState, MultisubSubplebbit } from '../../../hooks/use-default-subplebbits'; import useIsMobile from '../../../hooks/use-is-mobile'; import LoadingEllipsis from '../../../components/loading-ellipsis'; import styles from './boards-list.module.css'; const Board = ({ subplebbit, isMobile }: { subplebbit: MultisubSubplebbit; isMobile: boolean }) => { const { t } = useTranslation(); const { address, title, nsfw } = subplebbit || {}; const boardTitle = title?.replace(/^\/[^/]+\/\s*-\s*/, '') || ''; const displayAddress = address && Plebbit.getShortAddress(address); return (
{displayAddress} {nsfw && ({t('nsfw')})}
{boardTitle || displayAddress}
| {t('board')} | {t('title')} |
|---|