import styled from 'styled-components' import { endpoint } from '../config' const FileStyle = styled.div` display: grid; grid-template-columns: 250px 100px 1fr; grid-auto-flow: dense; align-items: start; justify-items: start; align-content: start; justify-content: start; a, img { grid-row: span 6; max-width: 230px; max-height: 140px; justify-self: center; } h2 { grid-column: span 2; margin: 0 0 0.5em 0; line-height: 1; } .description { grid-column: span 2; } p { margin: 0; line-height: 1.5; } ` const FileFields = { id: null, name: '', description: '', file: null } const FileFormFields = props => { const { state, onChange } = props const toState = event => { if (event.target.type === 'file') { onChange({ ...state, [event.target.name]: event.target.files[0] }) } else { onChange({ ...state, [event.target.name]: event.target.value }) } } return (
) } const File = props => { const { path, name, description, filename, mimetype, size } = props.data const downloadPath = `${endpoint}/${path}` return ({description}
Path
Filename
{filename}
MIME Type
{mimetype}
Size
{size}