mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +00:00
recently closed tabs
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
import moment from 'moment';
|
||||
import { getIconImage } from '../icons';
|
||||
|
||||
const openedTabAppObject = () => ({ tabid, props, selected, icon, title, busy }, { setOpenedTabs }) => {
|
||||
const closedTabAppObject = () => ({ tabid, props, selected, icon, title, closedTime, busy }, { setOpenedTabs }) => {
|
||||
const key = tabid;
|
||||
const Icon = (props) => getIconImage(icon, props);
|
||||
const isBold = !!selected;
|
||||
@@ -12,11 +13,12 @@ const openedTabAppObject = () => ({ tabid, props, selected, icon, title, busy },
|
||||
files.map((x) => ({
|
||||
...x,
|
||||
selected: x.tabid == tabid,
|
||||
closedTime: x.tabid == tabid ? undefined : x.closedTime,
|
||||
}))
|
||||
);
|
||||
};
|
||||
|
||||
return { title, key, Icon, isBold, onClick, isBusy: busy };
|
||||
return { title: `${title} ${moment(closedTime).fromNow()}`, key, Icon, isBold, onClick, isBusy: busy };
|
||||
};
|
||||
|
||||
export default openedTabAppObject;
|
||||
export default closedTabAppObject;
|
||||
Reference in New Issue
Block a user