import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { ElementName, IconType } from '../../../../../constants';
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
import { BaseBadgeElement, toBadgeProps } from '../common';
const LatestCommitElement = props => {
  var _context$latestCommit;
  const context = useFlexibleUiContext();
  const data = context ? toBadgeProps((_context$latestCommit = context.latestCommit) === null || _context$latestCommit === void 0 ? void 0 : _context$latestCommit.toString()) : null;
  return data ? /*#__PURE__*/React.createElement(BaseBadgeElement, _extends({
    icon: IconType.Commit
  }, data, props, {
    name: ElementName.LatestCommit
  })) : null;
};
export default LatestCommitElement;