2018-07-18 21:59:21 +00:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
|
|
|
|
import ms from 'ms'
|
|
|
|
|
2018-07-19 00:48:16 +00:00
|
|
|
export default function Stage ({ stage }) {
|
2018-07-18 21:59:21 +00:00
|
|
|
const { created_at: createdAt, title, content } = stage
|
|
|
|
const ago = ms(Date.now() - createdAt * 1000)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="stage">
|
|
|
|
<h3>{title}</h3>
|
|
|
|
<p>{content}</p>
|
|
|
|
<footer>{ago} ago</footer>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
Stage.propTypes = {
|
|
|
|
stage: PropTypes.shape({
|
|
|
|
created_at: PropTypes.number,
|
|
|
|
title: PropTypes.string,
|
|
|
|
content: PropTypes.string,
|
2018-07-19 00:48:16 +00:00
|
|
|
}),
|
2018-07-18 21:59:21 +00:00
|
|
|
}
|