import React, { VFC, memo } from 'react'; import styles from './styles.module.scss'; import { Icon } from '~/components/input/Icon'; import classNames from 'classnames'; import { Placeholder } from '~/components/placeholders/Placeholder'; import { getPrettyDate } from '~/utils/dom'; import { URLS } from '~/constants/urls'; import { Link } from 'react-router-dom'; interface IProps { id?: number; title: string; username?: string; createdAt: string; likeCount: number; isHeroic: boolean; isLocked: boolean; isLiked: boolean; canEdit: boolean; canLike: boolean; canStar: boolean; isLoading: boolean; onEdit: () => void; onLike: () => void; onStar: () => void; onLock: () => void; } const NodePanelInner: VFC = memo( ({ id, title, username, createdAt, likeCount, isHeroic, isLocked, isLiked, canStar, canEdit, canLike, isLoading, onStar, onEdit, onLike, onLock, }) => { return (
{isLoading ? : title || '...'}
{!!username && (
{isLoading ? ( ) : ( `~${username.toLocaleLowerCase()}, ${getPrettyDate(createdAt)}` )}
)}
{canEdit && (
{canStar && (
{isHeroic ? ( ) : ( )}
)}
{!!id && ( )}
)}
{canLike && (
{isLiked ? ( ) : ( )} {!!likeCount && likeCount > 0 && (
{likeCount}
)}
)}
); } ); export { NodePanelInner };