Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Jan 8, 2025
1 parent 3d4922b commit 7ed8294
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/component/panels/PanelsBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ButtonGroup, Colors } from '@blueprintjs/core';
import styled from '@emotion/styled';
import type { NMRiumPanelPreferences } from 'nmr-load-save';
import { ActivityBarItem, Toolbar } from 'react-science/ui';
import useResizeObserver from 'use-resize-observer';

import type { ToolbarPopoverMenuItem } from '../elements/ToolbarPopoverItem.js';
import { ToolbarPopoverItem } from '../elements/ToolbarPopoverItem.js';

import { useAccordionItems } from './hooks/useAccordionItems.js';
Expand All @@ -19,7 +21,10 @@ const PanelsBarContainer = styled(ButtonGroup)`
background-color: ${Colors.WHITE};
`;

function useHiddenItemsMenu(items, sliceIndex) {
function useHiddenItemsMenu(
items,
sliceIndex,
): Array<ToolbarPopoverMenuItem<{ id: keyof NMRiumPanelPreferences }>> {
const getPanelPreferences = useGetPanelOptions();
const hiddenItems = items.slice(sliceIndex);

Expand Down Expand Up @@ -72,13 +77,17 @@ export function PanelsBar({ itemHeight = 44 }) {
})}
{menu.length > 0 && (
<Toolbar>
<ToolbarPopoverItem<{ id: string }>
<ToolbarPopoverItem
placement="left"
tooltipProps={{ placement: 'left' }}
options={menu}
tooltip={`More panels [ +${menu.length} ]`}
icon="more"
onClick={(data) => togglePanel(data?.id)}
onClick={(data) => {
if (data?.id) {
togglePanel(data.id);
}
}}
active={isMenuActive}
/>
</Toolbar>
Expand Down

0 comments on commit 7ed8294

Please sign in to comment.