mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
0e71084600
[web] BS5 project tools GitOrigin-RevId: 3181c62985b6db4051292b484f53178a0736fa75
31 lines
904 B
TypeScript
31 lines
904 B
TypeScript
import { ButtonToolbar, ButtonToolbarProps } from 'react-bootstrap-5'
|
|
import {
|
|
ButtonToolbar as BS3ButtonToolbar,
|
|
ButtonToolbarProps as BS3ButtonToolbarProps,
|
|
} from 'react-bootstrap'
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
import { getAriaAndDataProps } from '@/features/utils/bootstrap-5'
|
|
|
|
type OLButtonToolbarProps = ButtonToolbarProps & {
|
|
bs3Props?: Record<string, unknown>
|
|
}
|
|
|
|
function OlButtonToolbar(props: OLButtonToolbarProps) {
|
|
const { bs3Props, ...rest } = props
|
|
|
|
const bs3ButtonToolbarProps: BS3ButtonToolbarProps = {
|
|
children: rest.children,
|
|
className: rest.className,
|
|
...getAriaAndDataProps(rest),
|
|
...bs3Props,
|
|
}
|
|
|
|
return (
|
|
<BootstrapVersionSwitcher
|
|
bs3={<BS3ButtonToolbar {...bs3ButtonToolbarProps} />}
|
|
bs5={<ButtonToolbar {...rest} />}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default OlButtonToolbar
|