<script>
import fields from '@yootheme/fields';

export default {
    name: 'FormActionsFields',

    extends: fields.components.FieldYooessentialsDatasetMulti,

    inject: {
        Form: {
            from: 'EssentialsForm',
        },
    },

    methods: {
        initOptions() {
            const actions = this.Form.actions;

            for (const name in actions) {
                const action = actions[name];
                this.options[name] = {
                    ...action,
                    panel: action,
                    titleFallback: action.title,
                };
            }
        },
    },
};
</script>
