@@ -12,7 +12,6 @@ import Edit from '@mui/icons-material/Edit';
1212import Security from '@mui/icons-material/Security' ;
1313import Button from '@mui/material/Button' ;
1414import Tooltip from '@mui/material/Tooltip' ;
15- import TimeAgo from 'react-timeago' ;
1615import ConfirmDialog from '../common/ConfirmDialog' ;
1716import DefaultPage from '../common/DefaultPage' ;
1817import AddClientDialog from './AddClientDialog' ;
@@ -21,7 +20,8 @@ import ElevateClientDialog from './ElevateClientDialog';
2120import { IClient } from '../types' ;
2221import CopyableSecret from '../common/CopyableSecret' ;
2322import { LastUsedCell } from '../common/LastUsedCell' ;
24- import { TimeAgoFormatter } from '../common/TimeAgoFormatter' ;
23+ import { formatDate } from '../common/TimeAgoFormatter' ;
24+ import { RemainingTime } from '../common/RemainingTime' ;
2525import { observer } from 'mobx-react-lite' ;
2626import { useStores } from '../stores' ;
2727
@@ -55,10 +55,10 @@ const Clients = observer(() => {
5555 < TableRow style = { { textAlign : 'center' } } >
5656 < TableCell > Name</ TableCell >
5757 < TableCell style = { { width : 200 } } > Token</ TableCell >
58- < TableCell > Last Used</ TableCell >
5958 < TableCell > Elevation ends</ TableCell >
60- < TableCell > Created</ TableCell >
6159 < TableCell > Expires in</ TableCell >
60+ < TableCell > Last Used</ TableCell >
61+ < TableCell > Created</ TableCell >
6262 < TableCell />
6363 < TableCell />
6464 < TableCell />
@@ -152,26 +152,22 @@ const Row = ({
152152 style = { { display : 'flex' , alignItems : 'center' , width : 250 } }
153153 />
154154 </ TableCell >
155- < TableCell >
156- < LastUsedCell lastUsed = { lastUsed } />
155+ < TableCell align = "right" title = { elevatedUntil } >
156+ < RemainingTime
157+ until = {
158+ elevatedUntil && Date . parse ( elevatedUntil ) > Date . now ( )
159+ ? elevatedUntil
160+ : undefined
161+ }
162+ />
157163 </ TableCell >
158- < TableCell >
159- { elevatedUntil && Date . parse ( elevatedUntil ) > Date . now ( ) ? (
160- < TimeAgo date = { elevatedUntil } formatter = { TimeAgoFormatter . longMinutes } />
161- ) : (
162- '-'
163- ) }
164+ < TableCell align = "right" className = "expires-in" title = { expiresAt ?? undefined } >
165+ < RemainingTime until = { expiresAt } />
164166 </ TableCell >
165167 < TableCell >
166- < TimeAgo date = { createdAt } formatter = { TimeAgoFormatter . long } />
167- </ TableCell >
168- < TableCell className = "expires-in" >
169- { expiresAt ? (
170- < TimeAgo date = { expiresAt } formatter = { TimeAgoFormatter . longMinutes } />
171- ) : (
172- '-'
173- ) }
168+ < LastUsedCell lastUsed = { lastUsed } />
174169 </ TableCell >
170+ < TableCell title = { createdAt } > { formatDate ( createdAt ) } </ TableCell >
175171 < TableCell align = "right" padding = "none" >
176172 < Tooltip title = "Elevate" >
177173 < IconButton onClick = { fElevate } className = "elevate" >
0 commit comments