2019-06-11 10:51:52 +10:00

25 lines
566 B
JavaScript

import { graphql } from 'react-apollo'
import uploadsQuery from '../queries/uploads'
import { Cell, Head, Table } from './Table'
const Uploads = ({ data: { uploads = [] } }) => (
<Table
thead={
<tr>
<Head>Filename</Head>
<Head>MIME type</Head>
<Head>Path</Head>
</tr>
}
tbody={uploads.map(({ id, filename, mimetype, path }) => (
<tr key={id}>
<Cell>{filename}</Cell>
<Cell>{mimetype}</Cell>
<Cell>{path}</Cell>
</tr>
))}
/>
)
export default graphql(uploadsQuery)(Uploads)