mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 22:25:59 -05:00
92eade7502
[web] BS5 pdf toolbar GitOrigin-RevId: a04091c9e936e52f47c3977b3149ffe613d43bb9
30 lines
890 B
TypeScript
30 lines
890 B
TypeScript
import { ButtonGroup, ButtonGroupProps } from 'react-bootstrap-5'
|
|
import {
|
|
ButtonGroup as BS3ButtonGroup,
|
|
ButtonGroupProps as BS3ButtonGroupProps,
|
|
} from 'react-bootstrap'
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
import { getAriaAndDataProps } from '@/features/utils/bootstrap-5'
|
|
|
|
type OLButtonGroupProps = ButtonGroupProps & {
|
|
bs3Props?: Record<string, unknown>
|
|
}
|
|
|
|
function OLButtonGroup({ bs3Props, as, ...rest }: OLButtonGroupProps) {
|
|
const bs3ButtonGroupProps: BS3ButtonGroupProps = {
|
|
children: rest.children,
|
|
className: rest.className,
|
|
vertical: rest.vertical,
|
|
...getAriaAndDataProps(rest),
|
|
...bs3Props,
|
|
}
|
|
|
|
return (
|
|
<BootstrapVersionSwitcher
|
|
bs3={<BS3ButtonGroup {...bs3ButtonGroupProps} />}
|
|
bs5={<ButtonGroup {...rest} as={as} />}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default OLButtonGroup
|