import React from 'react' import Link from 'next/link' import { ChevronRight } from 'react-feather' import next from 'next' interface Props { title: string date: Date image?: string alt?: string link: string } const months = [ "le 13eme mois", 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ] export default class Element extends React.Component { constructor(props: Props) { super(props) } render() { let date = this.props.date if (typeof this.props.date === "string") { date = new Date(this.props.date) } const t = `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}` return (
{this.props.image ? ( {this.props.alt}/ ) : (
)} Le {t} {this.props.title}
) } }