2024-05-29 10:17:37 -04:00
|
|
|
import PDFToolbarButton from './pdf-toolbar-button'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2024-10-08 10:22:13 -04:00
|
|
|
import OLButtonGroup from '@/features/ui/components/ol/ol-button-group'
|
2024-05-29 10:17:37 -04:00
|
|
|
|
|
|
|
const isMac = /Mac/.test(window.navigator?.platform)
|
|
|
|
|
|
|
|
type PdfZoomButtonsProps = {
|
|
|
|
setZoom: (zoom: string) => void
|
|
|
|
}
|
|
|
|
|
|
|
|
function PdfZoomButtons({ setZoom }: PdfZoomButtonsProps) {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
const zoomInShortcut = isMac ? '⌘+' : 'Ctrl++'
|
|
|
|
const zoomOutShortcut = isMac ? '⌘-' : 'Ctrl+-'
|
|
|
|
|
|
|
|
return (
|
2024-10-08 10:22:13 -04:00
|
|
|
<OLButtonGroup className="pdfjs-toolbar-buttons">
|
2024-05-29 10:17:37 -04:00
|
|
|
<PDFToolbarButton
|
|
|
|
tooltipId="pdf-controls-zoom-out-tooltip"
|
|
|
|
label={t('zoom_out')}
|
|
|
|
icon="remove"
|
|
|
|
onClick={() => setZoom('zoom-out')}
|
|
|
|
shortcut={zoomOutShortcut}
|
|
|
|
/>
|
|
|
|
<PDFToolbarButton
|
|
|
|
tooltipId="pdf-controls-zoom-in-tooltip"
|
|
|
|
label={t('zoom_in')}
|
|
|
|
icon="add"
|
|
|
|
onClick={() => setZoom('zoom-in')}
|
|
|
|
shortcut={zoomInShortcut}
|
|
|
|
/>
|
2024-10-08 10:22:13 -04:00
|
|
|
</OLButtonGroup>
|
2024-05-29 10:17:37 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PdfZoomButtons
|