2021-03-10 07:19:54 -05:00
|
|
|
import classNames from 'classnames'
|
2022-05-18 09:46:10 -04:00
|
|
|
import Tooltip from '../../../shared/components/tooltip'
|
2021-03-10 07:19:54 -05:00
|
|
|
import Icon from '../../../shared/components/icon'
|
|
|
|
|
2022-05-18 09:46:10 -04:00
|
|
|
type PdfToggleButtonProps = {
|
|
|
|
onClick: () => void
|
|
|
|
pdfViewIsOpen?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
function PdfToggleButton({ onClick, pdfViewIsOpen }: PdfToggleButtonProps) {
|
2021-03-10 07:19:54 -05:00
|
|
|
const classes = classNames(
|
|
|
|
'btn',
|
|
|
|
'btn-full-height',
|
|
|
|
'btn-full-height-no-border',
|
|
|
|
{
|
2021-04-27 03:52:58 -04:00
|
|
|
active: pdfViewIsOpen,
|
2021-03-10 07:19:54 -05:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
return (
|
2022-05-18 09:46:10 -04:00
|
|
|
<Tooltip
|
|
|
|
id="online-user"
|
|
|
|
description="PDF"
|
|
|
|
overlayProps={{ placement: 'bottom', trigger: ['hover', 'focus'] }}
|
2021-03-10 07:19:54 -05:00
|
|
|
>
|
|
|
|
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus */}
|
|
|
|
<a role="button" className={classes} onClick={onClick}>
|
2022-01-19 06:56:57 -05:00
|
|
|
<Icon type="file-pdf-o" fw accessibilityLabel="PDF" />
|
2021-03-10 07:19:54 -05:00
|
|
|
</a>
|
2022-05-18 09:46:10 -04:00
|
|
|
</Tooltip>
|
2021-03-10 07:19:54 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PdfToggleButton
|