2019-11-01 04:14:38 +04:00
|
|
|
import Link from 'next/link';
|
|
|
|
import { Author, AuthorImage, AuthorName, BlockLink, BlockMeta, BlockSubtitle, BlockTitle, PublishDate } from './style';
|
2019-11-06 18:20:09 +04:00
|
|
|
import { findByUsername } from 'lib/author';
|
2019-11-01 04:14:38 +04:00
|
|
|
|
|
|
|
const GuideBlock = ({ guide }) => {
|
|
|
|
const author = findByUsername(guide.author) || {};
|
|
|
|
return (
|
|
|
|
<div className="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12 grid-item-container">
|
2019-11-06 21:37:16 +04:00
|
|
|
<Link href={ guide.url } passHref>
|
2019-11-01 04:14:38 +04:00
|
|
|
<BlockLink>
|
|
|
|
<BlockTitle>{ guide.title }</BlockTitle>
|
|
|
|
<BlockSubtitle>{ guide.featuredDescription || guide.description }</BlockSubtitle>
|
|
|
|
<BlockMeta>
|
|
|
|
<Author>
|
|
|
|
<AuthorImage src={ author.picture } />
|
|
|
|
<AuthorName>{ author.name }</AuthorName>
|
|
|
|
</Author>
|
|
|
|
<PublishDate>{ guide.updatedAt }</PublishDate>
|
|
|
|
</BlockMeta>
|
|
|
|
</BlockLink>
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
2019-11-06 18:20:09 +04:00
|
|
|
export default GuideBlock;
|