Skip to content

Commit

Permalink
[desk-tool] refactor timeago component
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmeow authored and rexxars committed Oct 6, 2020
1 parent 0743242 commit 12d6698
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 78 deletions.
78 changes: 0 additions & 78 deletions packages/@sanity/desk-tool/src/components/TimeAgo.js

This file was deleted.

11 changes: 11 additions & 0 deletions packages/@sanity/desk-tool/src/components/TimeAgo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import {useTimeAgo} from '@sanity/base/hooks'

interface Props {
time: string | Date
}

export default function TimeAgo({time}: Props) {
const timeAgo = useTimeAgo(time)
return <span title={timeAgo}>{timeAgo}</span>
}

0 comments on commit 12d6698

Please sign in to comment.