export const getBlockCondition = (blocks, current) => {
    return [getBlockQuestionCondition(current), getBlocksFormCondition(blocks)];
};
const getBlockQuestionCondition = (block) => {
    return {
        name: 'question',
        label: 'Vraag',
        property: block.elements
            .map(el => {
            const question = 'question' in el && el.question;
            return question
                ? { name: el.id, label: question, input: 'text' }
                : undefined;
        })
            .filter(Boolean)
    };
};
const getBlocksFormCondition = (blocks) => {
    const forms = []
        .concat(...blocks.map(block => block.elements))
        .filter(el => el.type === 'form');
    return {
        name: 'form',
        label: 'Formulier',
        property: []
            .concat(...forms.map(form => form.input))
            .map(input => ({
            name: input.id,
            label: input.label,
            input: 'text'
        }))
    };
};
