import React, {FC, PropsWithChildren} from "react"; import classNames from "classnames"; import {Popover} from "@headlessui/react"; import {useFloating} from "@floating-ui/react"; import {createPortal} from "react-dom"; import {TestableCompositeData, useNodesStore} from "./store"; import {__} from "../globals"; import {normalizeTestableGroupMode, TestableGroupTypeId} from "./testableGroupTypes"; export type TestableGroupSeparatorProps = { style: 'icon' | 'text', className?: string, type: TestableCompositeData['type'], testableCompositeID: string } const groupModeOptions: {id: TestableCompositeData['type'], label: string}[] = [ {id: TestableGroupTypeId.AND, label: __('AND')}, /*{id: TestableGroupTypeId.OR, label: __('AND/OR')}, {id: TestableGroupTypeId.OR_EXCLUSIVE, label: __('OR')},*/ ] export const TestableGroupSeparator: FC = ({testableCompositeID, type, style, children, className = ''}) => { const {refs, floatingStyles} = useFloating(); const updateTestables = useNodesStore(state => state.updateTestables); const normalizedType = normalizeTestableGroupMode(type) || type return <> {children} {createPortal(

{__('Select the mode for all groups in this group')}

{groupModeOptions.map((mode) => { return ; })}
, document.body )}
}