mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
8ca159b4b9
PDF Detach GitOrigin-RevId: f69d8a87d1ba2115ad496a719106dfc7707a6ed5
28 lines
795 B
JavaScript
28 lines
795 B
JavaScript
import PropTypes from 'prop-types'
|
|
import classNames from 'classnames'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
function TrackChangesToggleButton({ trackChangesIsOpen, disabled, onClick }) {
|
|
const { t } = useTranslation()
|
|
const classes = classNames('btn', 'btn-full-height', {
|
|
active: trackChangesIsOpen && !disabled,
|
|
disabled: disabled,
|
|
})
|
|
|
|
return (
|
|
<div className="toolbar-item">
|
|
<button disabled={disabled} className={classes} onClick={onClick}>
|
|
<i className="review-icon" />
|
|
<p className="toolbar-label">{t('review')}</p>
|
|
</button>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
TrackChangesToggleButton.propTypes = {
|
|
trackChangesIsOpen: PropTypes.bool,
|
|
disabled: PropTypes.bool,
|
|
onClick: PropTypes.func.isRequired,
|
|
}
|
|
|
|
export default TrackChangesToggleButton
|