import { useState } from 'react';
import { AutoComplete, Button, Drawer, Input, Space } from 'antd';
import { OptionData, OptionGroupData } from 'rc-select/lib/interface/index';
import { Core } from 'cytoscape';
import shallow from 'zustand/shallow';
import useApplicationConfigStore from '../../stores/ApplicationConfigStore';
import useRulesVisualizerStore from '../../stores/RulesVisualizerStore';
import { getGraphJson } from '../../actions/RulesVisualizerActions';
import Text, { TextSizes } from '../../uikit/Text';
import { DEFAULT_ANIMATE_DURATION } from './RulesVisualizer';
import { LabelInfo } from '../../stores/ApplicationConfigStore';
import styles from './RulesVisualizerHeader.module.css';
const RulesVisualizerHeader = ({
cy,
setIsLoading,
showLabelUpstream,
showLabelDownstream,
}: {
cy: Core | null;
setIsLoading: Function;
showLabelUpstream: boolean;
showLabelDownstream: boolean;
}) => {
const [isDrawerVisible, setIsDrawerVisible] = useState(false);
const [labelInfoMapping, knownActionNames] = useApplicationConfigStore(
(state) => [state.labelInfoMapping, state.knownActionNames],
shallow
);
const [updateRuleVizGraph, nodes, selectedFeature, selectedFeatureType] = useRulesVisualizerStore(
(state) => [state.updateRuleVizGraph, state.nodes, state.selectedFeature, state.selectedFeatureType],
shallow
);
const selectedFeatureText = (