diff --git a/apps/web/src/components/conditions/Conditions.tsx b/apps/web/src/components/conditions/Conditions.tsx
new file mode 100644
index 00000000000..fb9e52c7a7c
--- /dev/null
+++ b/apps/web/src/components/conditions/Conditions.tsx
@@ -0,0 +1,320 @@
+import { Grid, Group, ActionIcon, Center } from '@mantine/core';
+import styled from '@emotion/styled';
+import { Controller, useFieldArray, useForm } from 'react-hook-form';
+
+import { FILTER_TO_LABEL, FilterPartTypeEnum } from '@novu/shared';
+
+import { Button, colors, Dropdown, Input, Select, Sidebar, Text, Title, Tooltip } from '../../design-system';
+import { ConditionPlus, DotsHorizontal, Duplicate, Trash, Condition, ErrorIcon } from '../../design-system/icons';
+import { When } from '../utils/When';
+import { IConditions } from '../../pages/integrations/types';
+
+export function Conditions({
+ isOpened,
+ conditions,
+ onClose,
+ setConditions,
+ name,
+}: {
+ isOpened: boolean;
+ onClose: () => void;
+ setConditions: (data: IConditions[]) => void;
+ conditions?: IConditions[];
+ name: string;
+}) {
+ const {
+ control,
+ setValue,
+ getValues,
+ trigger,
+ formState: { errors, isValid },
+ } = useForm({
+ defaultValues: { conditions },
+ shouldUseNativeValidation: false,
+ mode: 'onChange',
+ reValidateMode: 'onChange',
+ });
+
+ const { fields, append, update, remove, insert } = useFieldArray({
+ control,
+ name: `conditions.0.children`,
+ });
+
+ const FilterPartTypeList = [{ value: FilterPartTypeEnum.TENANT, label: FILTER_TO_LABEL[FilterPartTypeEnum.TENANT] }];
+
+ function handleOnChildOnChange(index: number) {
+ return (data) => {
+ const newField = Object.assign({}, fields[index], { on: data });
+ update(index, newField);
+ };
+ }
+
+ function updateConditions(data) {
+ setConditions(data.conditions);
+ onClose();
+ }
+
+ return (
+
+
+
+ Condition for {name} provider instance
+
+
+ }
+ customFooter={
+
+
+
+ 0}
+ label={!isValid ? 'Some conditions are missing values' : 'Add at least one condition'}
+ >
+
+
+
+
+
+
+ }
+ >
+ {fields.map((item, index) => {
+ return (
+
+
+
+ {index > 0 ? (
+
+ {
+ return (
+
+ );
+ }}
+ />
+
+ ) : (
+
+ When
+
+ )}
+
+
+ {
+ return (
+
+ );
+ }}
+ />
+
+
+ {
+ return (
+
+ );
+ }}
+ />
+
+
+ {
+ return (
+
+
+ {getValues(`conditions.0.children.${index}.operator`) !== 'IS_DEFINED' && (
+ {
+ return (
+
+
+
+
+
+
+
+
+
+ }
+ required
+ disabled={getValues(`conditions.0.children.${index}.operator`) === 'IS_DEFINED'}
+ error={!!fieldState.error}
+ placeholder="Value"
+ data-test-id="filter-value-input"
+ />
+ );
+ }}
+ />
+ )}
+
+
+
+
+
+ }
+ middlewares={{ flip: false, shift: false }}
+ position="bottom-end"
+ >
+ {
+ insert(index + 1, getValues(`conditions.0.children.${index}`));
+ }}
+ icon={}
+ >
+ Duplicate
+
+ {
+ remove(index);
+ }}
+ icon={}
+ >
+ Delete
+
+
+
+
+
+ );
+ })}
+
+
+
+
+
+ );
+}
+
+const Wrapper = styled.div`
+ .mantine-Select-wrapper:not(:hover) {
+ .mantine-Select-input {
+ border-color: transparent;
+ color: ${colors.B60};
+ }
+ .mantine-Input-rightSection.mantine-Select-rightSection {
+ svg {
+ display: none;
+ }
+ }
+ }
+`;
+
+const TooltipContainer = styled.div`
+ & .mantine-Tooltip-tooltip {
+ color: ${colors.error};
+ padding: 16px;
+ font-size: 14px;
+ font-weight: 400;
+ border-radius: 8px;
+ background: ${({ theme }) =>
+ `linear-gradient(0deg, rgba(229, 69, 69, 0.2) 0%, rgba(229, 69, 69, 0.2) 100%), ${
+ theme.colorScheme === 'dark' ? '#23232b' : colors.white
+ } !important`};
+ }
+
+ & .mantine-Tooltip-arrow {
+ background: ${({ theme }) =>
+ `linear-gradient(0deg, rgba(229, 69, 69, 0.2) 0%, rgba(229, 69, 69, 0.2) 100%), ${
+ theme.colorScheme === 'dark' ? '#23232b' : colors.white
+ } !important`};
+ }
+`;
diff --git a/apps/web/src/design-system/icons/actions/ConditionPlus.tsx b/apps/web/src/design-system/icons/actions/ConditionPlus.tsx
new file mode 100644
index 00000000000..1877a995c0b
--- /dev/null
+++ b/apps/web/src/design-system/icons/actions/ConditionPlus.tsx
@@ -0,0 +1,29 @@
+import React from 'react';
+
+export function ConditionPlus(props: React.ComponentPropsWithoutRef<'svg'>) {
+ return (
+
+ );
+}
diff --git a/apps/web/src/design-system/icons/actions/Duplicate.tsx b/apps/web/src/design-system/icons/actions/Duplicate.tsx
new file mode 100644
index 00000000000..10eee70d2ca
--- /dev/null
+++ b/apps/web/src/design-system/icons/actions/Duplicate.tsx
@@ -0,0 +1,12 @@
+import React from 'react';
+/* eslint-disable */
+export function Duplicate(props: React.ComponentPropsWithoutRef<'svg'>) {
+ return (
+
+ );
+}
diff --git a/apps/web/src/design-system/icons/actions/PlusFilled.tsx b/apps/web/src/design-system/icons/actions/PlusFilled.tsx
index 6087e41ca02..8c1eac0e7ea 100644
--- a/apps/web/src/design-system/icons/actions/PlusFilled.tsx
+++ b/apps/web/src/design-system/icons/actions/PlusFilled.tsx
@@ -7,14 +7,14 @@ export function PlusFilled(props: React.ComponentPropsWithoutRef<'svg'>) {
-
-
+
+
diff --git a/apps/web/src/design-system/icons/general/Condition.tsx b/apps/web/src/design-system/icons/general/Condition.tsx
index 73ec7b5f743..1593e16d602 100644
--- a/apps/web/src/design-system/icons/general/Condition.tsx
+++ b/apps/web/src/design-system/icons/general/Condition.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-/* eslint-disable */
+
export function Condition(props: React.ComponentPropsWithoutRef<'svg'>) {
return (
diff --git a/apps/web/src/design-system/icons/index.ts b/apps/web/src/design-system/icons/index.ts
index dcc7189b1c6..a209a84f806 100644
--- a/apps/web/src/design-system/icons/index.ts
+++ b/apps/web/src/design-system/icons/index.ts
@@ -94,6 +94,8 @@ export { Edit } from './actions/Edit';
export { Upload } from './actions/Upload';
export { Invite } from './actions/Invite';
export { PlusFilled } from './actions/PlusFilled';
+export { ConditionPlus } from './actions/ConditionPlus';
+export { Duplicate } from './actions/Duplicate';
export { ArrowDown } from './arrows/ArrowDown';
export { DoubleArrowRight } from './arrows/DoubleArrowRight';
diff --git a/apps/web/src/design-system/sidebar/Sidebar.tsx b/apps/web/src/design-system/sidebar/Sidebar.tsx
index 59508b2f91f..274fc147e2c 100644
--- a/apps/web/src/design-system/sidebar/Sidebar.tsx
+++ b/apps/web/src/design-system/sidebar/Sidebar.tsx
@@ -124,9 +124,9 @@ export const Sidebar = ({
trapFocus={false}
data-expanded={isExpanded}
>
-