2022-05-05 22:30:30 +00:00
|
|
|
import { DateTimeTooltip } from './datetime-tooltip'
|
2022-08-13 00:48:41 +00:00
|
|
|
import dayjs from 'dayjs'
|
2022-05-05 22:30:30 +00:00
|
|
|
import React from 'react'
|
|
|
|
|
|
|
|
export function RelativeTimestamp(props: { time: number }) {
|
|
|
|
const { time } = props
|
2022-08-13 00:48:41 +00:00
|
|
|
const dayJsTime = dayjs(time)
|
2022-05-05 22:30:30 +00:00
|
|
|
return (
|
2022-08-13 00:48:41 +00:00
|
|
|
<DateTimeTooltip
|
|
|
|
className="ml-1 whitespace-nowrap text-gray-400"
|
2022-08-27 20:46:35 +00:00
|
|
|
time={time}
|
2022-08-13 00:48:41 +00:00
|
|
|
>
|
|
|
|
{dayJsTime.fromNow()}
|
2022-05-05 22:30:30 +00:00
|
|
|
</DateTimeTooltip>
|
|
|
|
)
|
|
|
|
}
|