2022-01-01 19:37:33 +00:00
|
|
|
import React from 'react'
|
2022-02-05 10:55:34 +00:00
|
|
|
import { faCalendarPlus } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
import Badge from './Badge'
|
2022-01-01 19:37:33 +00:00
|
|
|
|
|
|
|
const CreatedAtBadge:React.FC<{ createdAt: string | null }> = ({ createdAt }) => {
|
|
|
|
return (
|
2022-02-05 10:55:34 +00:00
|
|
|
<Badge faIcon={faCalendarPlus}
|
|
|
|
label={'Created at'}
|
|
|
|
value={createdAt !== null ? (new Date(createdAt)).toLocaleDateString() : null}
|
|
|
|
className={'created-at'}
|
|
|
|
/>
|
2022-01-01 19:37:33 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
export default CreatedAtBadge
|