import React, { FC, useCallback } from 'react'; import { INode } from '~/redux/types'; import styles from './styles.module.scss'; import { CommentAvatar } from '~/components/comment/CommentAvatar'; import { openUserProfile } from '~/utils/user'; import { useRandomPhrase } from '~/constants/phrases'; interface Props { node?: INode; } const NodeAuthorBlock: FC = ({ node }) => { if (!node?.user) { return null; } const { fullname, username, description, photo } = node.user; const onOpenProfile = useCallback(() => openUserProfile(username), [username]); return (
{fullname || username}
{description && (
{description || useRandomPhrase('USER_DESCRIPTION')}
)}
); }; export { NodeAuthorBlock };