import React from 'react'; import classNames from 'classnames'; import { ToolButton } from '@ohif/ui-next'; import { useToolbar } from '@ohif/core/src/hooks/useToolbar'; /** * Wraps the ToolButtonList component to handle the OHIF toolbar button structure * @param props - Component props * @returns Component */ export function ToolBoxButtonGroupWrapper({ groupId, buttonSection, ...props }) { const { onInteraction, toolbarButtons } = useToolbar({ buttonSection, }); if (!groupId) { return null; } const items = toolbarButtons.map(button => button.componentProps); return (
{items.map(item => ( { onInteraction?.({ event, groupId, commands: item.commands, itemId: item.id, item, }); }} /> ))}
); } export function ToolBoxButtonWrapper({ onInteraction, className, options, ...props }) { return (
{ onInteraction?.({ event, itemId: props.id, commands: props.commands, options, }); }} />
); }