history-toggle-button.jsx 720 B

12345678910111213141516171819202122232425262728
  1. import PropTypes from 'prop-types'
  2. import classNames from 'classnames'
  3. import { useTranslation } from 'react-i18next'
  4. import Icon from '../../../shared/components/icon'
  5. function HistoryToggleButton({ historyIsOpen, onClick }) {
  6. const { t } = useTranslation()
  7. const classes = classNames('btn', 'btn-full-height', {
  8. active: historyIsOpen,
  9. })
  10. return (
  11. <div className="toolbar-item">
  12. <button className={classes} onClick={onClick}>
  13. <Icon type="history" fw />
  14. <p className="toolbar-label">{t('history')}</p>
  15. </button>
  16. </div>
  17. )
  18. }
  19. HistoryToggleButton.propTypes = {
  20. historyIsOpen: PropTypes.bool,
  21. onClick: PropTypes.func.isRequired,
  22. }
  23. export default HistoryToggleButton