mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
@ -1,24 +0,0 @@
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Text } from 'react-native'
|
||||
import TimeAgo from 'react-timeago'
|
||||
// @ts-ignore
|
||||
import buildFormatter from 'react-timeago/lib/formatters/buildFormatter'
|
||||
|
||||
export interface Props {
|
||||
date: string | number
|
||||
}
|
||||
|
||||
const RelativeTime: React.FC<Props> = ({ date }) => {
|
||||
const { t } = useTranslation('componentRelativeTime')
|
||||
|
||||
return (
|
||||
<TimeAgo
|
||||
date={date}
|
||||
component={Text}
|
||||
formatter={buildFormatter(t('strings', { returnObjects: true }))}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default RelativeTime
|
Reference in New Issue
Block a user