HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/triad-infosec/wp-content/plugins/widget-google-reviews/build/index.js
(function(blocks, editor, element, components, api) {

    var el            = element.createElement,
        SelectControl = components.SelectControl,
        Button        = components.Button,
        __            = wp.i18n.__;

    blocks.registerBlockType('widget-google-reviews/reviews', {
        title: __('Google Reviews Block', 'widget-google-reviews'),
        icon: 'star-filled',
        category: 'widgets',
        keywords: ['google', 'reviews', 'block'],
        attributes: {id: {type: 'string'}},

        edit: function(props) {

            var attributes = props.attributes;
            var blockProps = wp.blockEditor.useBlockProps();

            let feeds = grwBlockData.feeds,
                options = [{label: __('Select reviews widget'), value: 0}];

            for (let i = 0; i < feeds.length; i++) {
                options.push({label: feeds[i].name, value: feeds[i].id});
            }

            return el(
                'div',
                blockProps,
                el(
                    SelectControl,
                    {
                        id: 'id',
                        name: 'id',
                        value: props.attributes.id,
                        options: options,
                        onChange: function(newval) {
                            props.setAttributes({id: newval});
                        }
                    }
                ),
                el(
                    Button,
                    {
                        text: __('Edit reviews widget'),
                        href: grwBlockData.builderUrl + '&grw_feed_id=' + props.attributes.id,
                        target: '_blank'
                    }
                ),
                el(
                    Button,
                    {
                        text: __('Create new reviews widget'),
                        href: grwBlockData.builderUrl,
                        target: '_blank'
                    }
                )
            );
        },

        save: function(props) {
            return null;
        }
    });
}(
    window.wp.blocks,
    window.wp.editor,
    window.wp.element,
    window.wp.components,
    window.wp.api
));