Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const Log = logItem => {
const { type, date, message } = logItem;
// const formatDate = moment(date).isValid() ? moment(date).format('YYYY-MM-DD HH:mm:ss') : '';
const messageGroup = message.split('\n');
return (
<li>
{typeof type === 'string' ? type.toLocaleUpperCase() : 'UNKNOW'}
<p>
{formatDate(date, {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})}
</p>
<div>
{messageGroup.map((msg, i) => (
<p>
{msg}
</p></div></li>