mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
* Rename dropdown primitives to OL-prefixed components * Migrate all consumers to OL-prefixed dropdown components * Migrate subscription dropdown shells to OL components * Update pdf-preview story to OL-prefixed dropdown components * Migrate navbar and spelling dropdowns to OL components * Move dropdown primitives to ol/ol-dropdown-menu, remove BS5 import aliases * Rename dropdown prop types to OL-prefixed, clean up BS5 import aliases * Widen OLDropdownItem/Toggle/Menu props to include AriaAttributes and data-* GitOrigin-RevId: 0babce46867849b3f176bac8cf1652dc76fd34da
34 lines
946 B
TypeScript
34 lines
946 B
TypeScript
import { OLDropdownMenu } from '@/shared/components/ol/ol-dropdown-menu'
|
|
import { RailTabKey } from '@/features/ide-react/context/rail-context'
|
|
import { RailElement } from '@/features/ide-react/util/rail-types'
|
|
import RailTab from './rail-tab'
|
|
import { shouldIncludeElement } from '@/features/ide-react/util/rail-utils'
|
|
|
|
export default function RailOverflowDropdown({
|
|
tabs,
|
|
isOpen,
|
|
selectedTab,
|
|
}: {
|
|
tabs: RailElement[]
|
|
isOpen: boolean
|
|
selectedTab: RailTabKey
|
|
}) {
|
|
return (
|
|
<OLDropdownMenu className="ide-rail-overflow-dropdown">
|
|
{tabs
|
|
.filter(shouldIncludeElement)
|
|
.map(({ icon, key, indicator, title, disabled }) => (
|
|
<RailTab
|
|
open={isOpen && selectedTab === key}
|
|
key={key}
|
|
eventKey={key}
|
|
icon={icon}
|
|
indicator={indicator}
|
|
title={title}
|
|
disabled={disabled}
|
|
/>
|
|
))}
|
|
</OLDropdownMenu>
|
|
)
|
|
}
|