Skip to content

Commit fd5888e

Browse files
committed
Restore component/post
1 parent d1c11c5 commit fd5888e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

components/post.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
/* eslint-disable camelcase */
12
import {useEffect} from 'react'
23
import PropTypes from 'prop-types'
3-
import Link from 'next/link'
44
import Image from 'next/image'
5+
import Link from 'next/link'
6+
7+
import {shortDate} from '@/lib/date-utils.js'
58

69
import colors from '@/styles/colors.js'
710

8-
const Post = ({baseUrl, title, html, authors}) => {
11+
const Post = ({baseUrl, authors, published_at, reading_time, title, html}) => {
912
useEffect(() => {
1013
const audioPlayers = [...document.querySelectorAll('audio')]
1114
const videoPlayers = [...document.querySelectorAll('video')]
@@ -56,6 +59,7 @@ const Post = ({baseUrl, title, html, authors}) => {
5659
<div className='names'>
5760
{authors.map(author => <span key={author.id}>{author.name} </span>)}
5861
</div>
62+
<div className='date'>Publié le {shortDate(published_at)} - {reading_time} min de lecture</div>
5963
</div>
6064
</div>
6165
</div>
@@ -517,9 +521,11 @@ const Post = ({baseUrl, title, html, authors}) => {
517521

518522
Post.propTypes = {
519523
baseUrl: PropTypes.string.isRequired,
524+
authors: PropTypes.array.isRequired,
525+
published_at: PropTypes.string.isRequired,
526+
reading_time: PropTypes.number.isRequired,
520527
title: PropTypes.string.isRequired,
521-
html: PropTypes.node.isRequired,
522-
authors: PropTypes.array.isRequired
528+
html: PropTypes.node.isRequired
523529
}
524530

525531
export default Post

0 commit comments

Comments
 (0)