2024-08-22 08:14:22 -04:00
|
|
|
import { MenuItem, MenuItemProps } from 'react-bootstrap'
|
|
|
|
import { DropdownItem } from '@/features/ui/components/bootstrap-5/dropdown-menu'
|
|
|
|
import { DropdownItemProps } from '@/features/ui/components/types/dropdown-menu-props'
|
|
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
|
|
|
2024-10-14 04:00:41 -04:00
|
|
|
type OLDropdownMenuItemProps = DropdownItemProps & {
|
2024-08-22 08:14:22 -04:00
|
|
|
bs3Props?: MenuItemProps
|
|
|
|
}
|
|
|
|
|
2024-10-14 04:00:41 -04:00
|
|
|
function OLDropdownMenuItem(props: OLDropdownMenuItemProps) {
|
2024-08-22 08:14:22 -04:00
|
|
|
const { bs3Props, ...rest } = props
|
|
|
|
|
|
|
|
const bs3MenuItemProps: MenuItemProps = {
|
2024-10-14 04:00:41 -04:00
|
|
|
children: rest.leadingIcon ? (
|
|
|
|
<>
|
|
|
|
{rest.leadingIcon}
|
|
|
|
|
|
|
|
{rest.children}
|
|
|
|
</>
|
|
|
|
) : (
|
|
|
|
rest.children
|
|
|
|
),
|
2024-08-22 08:14:22 -04:00
|
|
|
onClick: rest.onClick,
|
2024-10-14 04:00:41 -04:00
|
|
|
href: rest.href,
|
|
|
|
download: rest.download,
|
2024-08-22 08:14:22 -04:00
|
|
|
...bs3Props,
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<BootstrapVersionSwitcher
|
|
|
|
bs3={<MenuItem {...bs3MenuItemProps} />}
|
|
|
|
bs5={<DropdownItem {...rest} />}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-10-14 04:00:41 -04:00
|
|
|
export default OLDropdownMenuItem
|