[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1009 B

import React, { FC, useEffect } from 'react'
import noop from 'lodash/noop'
import moment from 'moment'
import { GroupLog } from 'src/types'
export interface Props {
group: string
logs?: GroupLog[]
fetchLogs?: () => void
}
const MemberList: FC<Props> = ({ group, logs = [], fetchLogs = noop }) => {
useEffect(() => {
if (logs.length === 0) fetchLogs()
}, [group])
return (
<table className="table">
<thead>
<tr>
<th>Who</th>
<th>What</th>
<th>When</th>
</tr>
</thead>
<tbody>
{logs.map(log => (
<tr>
<td>{log.user.id}</td>
<td>{log.content}</td>
<td>{moment(log.created).format('MMMM Do YYYY, h:mm:ss a')}</td>
</tr>
))}
</tbody>
</table>
)
}
export default MemberList