mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
22 lines
542 B
TypeScript
22 lines
542 B
TypeScript
import './ArticleItem.scss';
|
|
import { Component } from 'solid-js';
|
|
import { IArticle } from '@root/interfaces';
|
|
import { DateFormatter } from '@utils/date';
|
|
|
|
export type ArticleItemProps = {
|
|
data: IArticle;
|
|
};
|
|
|
|
export const ArticleItem: Component<ArticleItemProps> = ({ data }) => (
|
|
<article class='article-item'>
|
|
<a href='#'>
|
|
<h3>{data.title}</h3>
|
|
<p>
|
|
<time datetime={data.published_at.toString()}>
|
|
{DateFormatter.format(new Date(data.published_at))}
|
|
</time>
|
|
</p>
|
|
</a>
|
|
</article>
|
|
);
|