import React from 'react'; import PropTypes from 'prop-types'; import { format } from 'date-fns'; import { UserPicture } from '@growi/ui'; import { pagePathUtils } from '@growi/core'; const { userPageRoot } = pagePathUtils; const formatType = 'yyyy/MM/dd HH:mm'; const AuthorInfo = (props) => { const { mode, user, date, locate, } = props; const infoLabelForSubNav = mode === 'create' ? 'Created by' : 'Updated by'; const infoLabelForFooter = mode === 'create' ? 'Created at' : 'Last revision posted at'; const userLabel = user != null ? {user.name} : Unknown; if (locate === 'footer') { try { return
{infoLabelForFooter} {format(new Date(date), formatType)} by
{infoLabelForSubNav}