fedisearch/application/src/components/badges/CreatedAtBadge.tsx

15 wiersze
462 B
TypeScript
Czysty Zwykły widok Historia

2022-01-01 19:37:33 +00:00
import React from 'react'
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 (
<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