2021-09-30 07:29:25 -04:00
|
|
|
import { ButtonGroup } from 'react-bootstrap'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import Button from 'react-bootstrap/lib/Button'
|
|
|
|
import Icon from '../../../shared/components/icon'
|
|
|
|
import { memo } from 'react'
|
2023-09-15 03:13:22 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2021-09-30 07:29:25 -04:00
|
|
|
|
|
|
|
function PdfViewerControls({ setZoom }) {
|
2023-09-15 03:13:22 -04:00
|
|
|
const { t } = useTranslation()
|
2021-09-30 07:29:25 -04:00
|
|
|
return (
|
|
|
|
<ButtonGroup>
|
|
|
|
<Button
|
2023-09-15 03:13:22 -04:00
|
|
|
aria-label={t('fit_to_width')}
|
|
|
|
bsSize="large"
|
2022-12-16 09:45:20 -05:00
|
|
|
bsStyle={null}
|
|
|
|
className="btn-secondary-info btn-secondary"
|
2021-09-30 07:29:25 -04:00
|
|
|
onClick={() => setZoom('fit-width')}
|
|
|
|
>
|
|
|
|
<Icon type="arrows-h" />
|
|
|
|
</Button>
|
|
|
|
<Button
|
2023-09-15 03:13:22 -04:00
|
|
|
aria-label={t('fit_to_height')}
|
|
|
|
bsSize="large"
|
2022-12-16 09:45:20 -05:00
|
|
|
bsStyle={null}
|
|
|
|
className="btn-secondary-info btn-secondary"
|
2021-09-30 07:29:25 -04:00
|
|
|
onClick={() => setZoom('fit-height')}
|
|
|
|
>
|
|
|
|
<Icon type="arrows-v" />
|
|
|
|
</Button>
|
2022-12-16 09:45:20 -05:00
|
|
|
<Button
|
2023-09-15 03:13:22 -04:00
|
|
|
aria-label={t('zoom_in')}
|
|
|
|
bsSize="large"
|
2022-12-16 09:45:20 -05:00
|
|
|
bsStyle={null}
|
|
|
|
className="btn-secondary-info btn-secondary"
|
|
|
|
onClick={() => setZoom('zoom-in')}
|
|
|
|
>
|
2021-09-30 07:29:25 -04:00
|
|
|
<Icon type="search-plus" />
|
|
|
|
</Button>
|
2022-12-16 09:45:20 -05:00
|
|
|
<Button
|
2023-09-15 03:13:22 -04:00
|
|
|
aria-label={t('zoom_out')}
|
|
|
|
bsSize="large"
|
2022-12-16 09:45:20 -05:00
|
|
|
bsStyle={null}
|
|
|
|
className="btn-secondary-info btn-secondary"
|
|
|
|
onClick={() => setZoom('zoom-out')}
|
|
|
|
>
|
2021-09-30 07:29:25 -04:00
|
|
|
<Icon type="search-minus" />
|
|
|
|
</Button>
|
|
|
|
</ButtonGroup>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
PdfViewerControls.propTypes = {
|
|
|
|
setZoom: PropTypes.func.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfViewerControls)
|