mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 23:36:00 -05:00
92eade7502
[web] BS5 pdf toolbar GitOrigin-RevId: a04091c9e936e52f47c3977b3149ffe613d43bb9
44 lines
958 B
TypeScript
44 lines
958 B
TypeScript
import MaterialIcon from '@/shared/components/material-icon'
|
|
import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
|
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
|
|
|
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 (
|
|
<OLTooltip
|
|
id={tooltipId}
|
|
description={
|
|
<>
|
|
<div>{label}</div>
|
|
{shortcut && <div>{shortcut}</div>}
|
|
</>
|
|
}
|
|
overlayProps={{ placement: 'bottom' }}
|
|
>
|
|
<OLButton
|
|
variant="ghost"
|
|
className="pdf-toolbar-btn pdfjs-toolbar-button"
|
|
disabled={disabled}
|
|
onClick={onClick}
|
|
aria-label={label}
|
|
>
|
|
<MaterialIcon type={icon} />
|
|
</OLButton>
|
|
</OLTooltip>
|
|
)
|
|
}
|