import { Tooltip } from "antd";
import moment from "moment";
import React from "react";

export default function TimeAgoFormatter(props) {
  const m = moment(props.children);
  return props.children ? (
    <Tooltip placement="top" title={m.format("MM/DD/YYY hh:mm A")}>
      {m.fromNow()}
    </Tooltip>
  ) : null;
}
