framework/js/old/common/helpers/userOnline.js
2020-04-18 09:02:49 -04:00

14 lines
321 B
JavaScript

import icon from './icon';
/**
* The `useronline` helper displays a green circle if the user is online
*
* @param {User} user
* @return {Object}
*/
export default function userOnline(user) {
if (user.lastSeenAt() && user.isOnline()) {
return <span className="UserOnline">{icon('fas fa-circle')}</span>;
}
}