{
onChange({
...conditionsListDescriptor,
conditions,
})
}}
/>
{(conditionsListDescriptor.conditions.length > 1 ||
conditionsListDescriptor.conditions.find(
(condition) => condition.relation
)) && (
{__('Advanced Mode', 'blocksy-companion')}
{
if (
conditionsListDescriptor.conditions.find(
(condition) => condition.relation
)
) {
onChange({
...conditionsListDescriptor,
conditions:
conditionsListDescriptor.conditions.reduce(
(acc, condition) => {
return [
...acc,
...(condition.conditions
? condition.conditions
: [condition]),
]
},
[]
),
})
}
setIsAdvancedMode(value)
}}
option={{
behavior: 'boolean',
}}
/>
)}