9c4c325e5a
* remove submodules * add api and ui files * update github actions * use sparse checkout * update node setup * update checkout * update docker * change permissions * update mariadb health check * update changelog
26 lines
496 B
TypeScript
26 lines
496 B
TypeScript
import { Tooltip } from 'antd'
|
|
import dayjs from 'dayjs'
|
|
import relativeTime from 'dayjs/plugin/relativeTime'
|
|
import React from 'react'
|
|
|
|
dayjs.extend(relativeTime)
|
|
|
|
interface Props {
|
|
date: string
|
|
}
|
|
|
|
export const TimeAgo: React.FC<Props> = (props) => {
|
|
const date = dayjs(props.date)
|
|
return (
|
|
<Tooltip title={date.format('YYYY-MM-DD HH:mm:ss')}>
|
|
<div
|
|
style={{
|
|
display: 'inline-block',
|
|
}}
|
|
>
|
|
{date.fromNow()}
|
|
</div>
|
|
</Tooltip>
|
|
)
|
|
}
|