Skip to content

Commit

Permalink
Restore component/post
Browse files Browse the repository at this point in the history
  • Loading branch information
flacombe committed Jan 15, 2025
1 parent d1c11c5 commit fd5888e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions components/post.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/* eslint-disable camelcase */
import {useEffect} from 'react'
import PropTypes from 'prop-types'
import Link from 'next/link'
import Image from 'next/image'
import Link from 'next/link'

import {shortDate} from '@/lib/date-utils.js'

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

const Post = ({baseUrl, title, html, authors}) => {
const Post = ({baseUrl, authors, published_at, reading_time, title, html}) => {
useEffect(() => {
const audioPlayers = [...document.querySelectorAll('audio')]
const videoPlayers = [...document.querySelectorAll('video')]
Expand Down Expand Up @@ -56,6 +59,7 @@ const Post = ({baseUrl, title, html, authors}) => {
<div className='names'>
{authors.map(author => <span key={author.id}>{author.name} </span>)}
</div>
<div className='date'>Publié le {shortDate(published_at)} - {reading_time} min de lecture</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -517,9 +521,11 @@ const Post = ({baseUrl, title, html, authors}) => {

Post.propTypes = {
baseUrl: PropTypes.string.isRequired,
authors: PropTypes.array.isRequired,
published_at: PropTypes.string.isRequired,
reading_time: PropTypes.number.isRequired,
title: PropTypes.string.isRequired,
html: PropTypes.node.isRequired,
authors: PropTypes.array.isRequired
html: PropTypes.node.isRequired
}

export default Post

0 comments on commit fd5888e

Please sign in to comment.