manifold/web/components/relative-timestamp.tsx
Marshall Polaris 4b513a894d
Make tooltip rendering more efficient (#807)
* Don't use very slow dayjs formatter on timestamp tooltips

* Kill dead code in feed-bets.tsx

* Clean up tooltip markup
2022-08-27 13:46:35 -07:00

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>
)
}