import React from "react"
import PropTypes from "prop-types"
import { File } from "../generated/graphql"
import sizeToReadable from "../functions/sizeToReadable"

interface Props {
    file: File
}

const FileElement: React.FC<Props> = (props) => {
	return (
		<>
			<td>
				📄 {props.file.name}
			</td>
			<td>
				{sizeToReadable(props.file.size)}
			</td>
		</>
	)
}

FileElement.propTypes = {
	file: PropTypes.any.isRequired
}

export default FileElement
