import { useEffect } from 'react'; import { FormattedMessage } from 'react-intl'; import { fetchExtendedDescription } from 'mastodon/actions/server'; import { Account } from 'mastodon/components/account'; import { Skeleton } from 'mastodon/components/skeleton'; import { useAppSelector, useAppDispatch } from 'mastodon/store'; import classes from './styles.module.scss'; const Placeholder = () => (
); export const About = () => { const dispatch = useAppDispatch(); const server = useAppSelector((state) => state.server.server); const extendedDescription = useAppSelector( (state) => state.server.extendedDescription, ); const accountId = server.item?.contact.account?.id ?? ''; const isLoading = extendedDescription.isLoading; const hasContent = (extendedDescription.item?.content.length ?? 0) > 0; const content = extendedDescription.item?.content ?? ''; useEffect(() => { void dispatch(fetchExtendedDescription()); }, [dispatch]); return ( <>

{isLoading ? ( ) : hasContent ? (
) : (

)}
); };