2024-05-29 10:17:37 -04:00
|
|
|
import Button from 'react-bootstrap/lib/Button'
|
|
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
import Tooltip from '@/shared/components/tooltip'
|
|
|
|
|
|
|
|
type PDFToolbarButtonProps = {
|
|
|
|
tooltipId: string
|
|
|
|
icon: string
|
|
|
|
label: string
|
|
|
|
onClick: () => void
|
|
|
|
shortcut?: string
|
|
|
|
disabled?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function PDFToolbarButton({
|
|
|
|
tooltipId,
|
|
|
|
disabled,
|
|
|
|
label,
|
|
|
|
icon,
|
|
|
|
onClick,
|
|
|
|
shortcut,
|
|
|
|
}: PDFToolbarButtonProps) {
|
|
|
|
return (
|
|
|
|
<Tooltip
|
|
|
|
id={tooltipId}
|
|
|
|
description={
|
|
|
|
<>
|
|
|
|
<div>{label}</div>
|
|
|
|
{shortcut && <div>{shortcut}</div>}
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
overlayProps={{ placement: 'bottom' }}
|
|
|
|
>
|
|
|
|
<Button
|
|
|
|
aria-label={label}
|
|
|
|
bsSize="large"
|
|
|
|
bsStyle={null}
|
2024-05-31 04:51:27 -04:00
|
|
|
className="pdf-toolbar-btn pdfjs-toolbar-button"
|
2024-05-29 10:17:37 -04:00
|
|
|
disabled={disabled}
|
|
|
|
onClick={onClick}
|
|
|
|
>
|
|
|
|
<MaterialIcon type={icon} />
|
|
|
|
</Button>
|
|
|
|
</Tooltip>
|
|
|
|
)
|
|
|
|
}
|