import React, { FC, useMemo } from 'react'; import styles from './styles.module.scss'; import { getPrettyDate } from '~/utils/dom'; import { IGithubIssue } from '~/redux/boris/types'; import classNames from 'classnames'; interface IProps { data: IGithubIssue; } const stateLabels: Record = { open: 'Ожидает', closed: 'Сделано', }; const BorisStatsGitCard: FC = ({ data: { created_at, title, html_url, state } }) => { if (!title || !created_at) return null; const date = useMemo(() => getPrettyDate(created_at), [created_at]); return (
{stateLabels[state]} {date}
{title}
); }; export { BorisStatsGitCard };