import * as React from 'react'; import moment, { Moment } from 'moment'; import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid'; interface Props { date: null | number; className?: string; } export const LinkPreviewDate: React.FC = ({ date, className = '', }: Props) => { const dateMoment: Moment | null = isLinkPreviewDateValid(date) ? moment(date) : null; return dateMoment ? ( ) : null; };