import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["onRender"];
import React, { useEffect } from 'react';
import { ElementName } from '../../../../../constants';
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
import { BaseDateTimeElement, toDateTimeProps } from '../common';
var ModifiedOnElement = function ModifiedOnElement(props) {
  var context = useFlexibleUiContext();
  var data = context ? toDateTimeProps('modified', context.modifiedOn) : null;
  var _ref = props || {},
    onRender = _ref.onRender,
    restProps = _objectWithoutProperties(_ref, _excluded);
  useEffect(function () {
    onRender === null || onRender === void 0 || onRender(!!data);
  }, [data, onRender]);
  return data ? /*#__PURE__*/React.createElement(BaseDateTimeElement, _extends({}, data, restProps, {
    name: ElementName.ModifiedOn
  })) : null;
};
export default ModifiedOnElement;