import React from 'react'; import classNames from 'classnames'; import moment from 'moment'; // tslint:disable-next-line:match-default-export-name import formatFileSize from 'filesize'; type Props = { // Required timestamp: number; // Optional fileName?: string; fileSize?: number | null; onClick?: () => void; shouldShowSeparator?: boolean; }; export const DocumentListItem = (props: Props) => { const { shouldShowSeparator, fileName, fileSize, timestamp } = props; const defaultShowSeparator = shouldShowSeparator === undefined ? true : shouldShowSeparator; return (
{fileName} {typeof fileSize === 'number' ? formatFileSize(fileSize) : ''}
{moment(timestamp).format('ddd, MMM D, Y')}
); };