4b513a894d
* Don't use very slow dayjs formatter on timestamp tooltips * Kill dead code in feed-bets.tsx * Clean up tooltip markup
17 lines
392 B
TypeScript
17 lines
392 B
TypeScript
import { DateTimeTooltip } from './datetime-tooltip'
|
|
import dayjs from 'dayjs'
|
|
import React from 'react'
|
|
|
|
export function RelativeTimestamp(props: { time: number }) {
|
|
const { time } = props
|
|
const dayJsTime = dayjs(time)
|
|
return (
|
|
<DateTimeTooltip
|
|
className="ml-1 whitespace-nowrap text-gray-400"
|
|
time={time}
|
|
>
|
|
{dayJsTime.fromNow()}
|
|
</DateTimeTooltip>
|
|
)
|
|
}
|