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