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