2024-08-22 08:14:22 -04:00
|
|
|
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>
|
|
|
|
}
|
|
|
|
|
2024-09-25 09:46:17 -04:00
|
|
|
function OLButtonToolbar(props: OLButtonToolbarProps) {
|
2024-08-22 08:14:22 -04:00
|
|
|
const { bs3Props, ...rest } = props
|
|
|
|
|
|
|
|
const bs3ButtonToolbarProps: BS3ButtonToolbarProps = {
|
|
|
|
children: rest.children,
|
|
|
|
className: rest.className,
|
|
|
|
...getAriaAndDataProps(rest),
|
|
|
|
...bs3Props,
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<BootstrapVersionSwitcher
|
|
|
|
bs3={<BS3ButtonToolbar {...bs3ButtonToolbarProps} />}
|
|
|
|
bs5={<ButtonToolbar {...rest} />}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-09-25 09:46:17 -04:00
|
|
|
export default OLButtonToolbar
|