import React from 'react'; import { Icon, Input } from 'UI'; import cn from 'classnames'; import { FilterList } from 'Shared/Filters/FilterList'; import { observer } from 'mobx-react-lite'; import { Typography } from 'antd'; import { BranchesOutlined } from '@ant-design/icons'; interface Props { set: number; removeCondition: (ind: number) => void; index: number; readonly?: boolean; onAddFilter: (filter: Record) => void; conditions: any; bottomLine1: string; bottomLine2: string; onPercentChange: (e: React.ChangeEvent) => void; excludeFilterKeys?: string[]; onUpdateFilter: (filterIndex: number, filter: any) => void; onRemoveFilter: (filterIndex: number) => void; onChangeEventsOrder: (_: any, { name, value }: any) => void; isConditional?: boolean; changeName: (name: string) => void; isMobile?: boolean; } function ConditionSetComponent({ removeCondition, index, set, readonly, onAddFilter, bottomLine1, bottomLine2, onPercentChange, excludeFilterKeys, conditions, onUpdateFilter, onRemoveFilter, onChangeEventsOrder, isConditional, isMobile, changeName, }: Props) { return (
{conditions.name ? (
{conditions.name}
) : ( <>
Condition
Set {set}
)} {readonly ? null : (
removeCondition(index)} >
)}
0 ? 'p-2 mb-2' : ''}> {readonly && !conditions.filter?.filters?.length ? (
No conditions
) : null}
{bottomLine1} {readonly ? (
{conditions.rolloutPercentage}%
) : ( %
} /> )} {bottomLine2}
); } export default observer(ConditionSetComponent);