HEX
Server: Apache
System: Linux www 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64
User: root (0)
PHP: 8.2.1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals
Upload Files
File: /mnt/drbd/www/edenhouse/wp-content/plugins/essential-blocks/blocks/number-counter/src/save.js
/**
 * WordPress dependencies
 */
import { __ } from "@wordpress/i18n";
import { RichText } from "@wordpress/block-editor";
const { EBDisplayIcon, BlockProps } = window.EBControls;
/**
 * Internal dependencies
 */

const Save = ({ attributes }) => {
    const {
        // blockId attribute for making unique className and other uniqueness ⬇
        blockId,

        // counter settings attributes ⬇
        target,
        duration,
        counterTitle,
        counterSuffix,
        counterPrefix,
        startValue,
        isShowSeparator,
        separator,

        //
        media,
        selectedIcon,
        imageUrl,
        titleLevel,
        classHook,
    } = attributes;

    return (
        <BlockProps.Save attributes={attributes}>
            <div
                className={`eb-parent-wrapper eb-parent-${blockId} ${classHook}`}
            >
                <div className={`${blockId} eb-counter-wrapper`}>
                    {media === "icon" ? (
                        <div className="icon-img-wrapper">
                            <div className="eb-icon ">
                                <EBDisplayIcon icon={selectedIcon} className={`eb-counter-icon-data-selector`} />
                            </div>
                        </div>
                    ) : null}

                    {media === "image" ? (
                        <div className="icon-img-wrapper">
                            <div className="eb-counter-image-wrapper">
                                <img
                                    className="eb-counter-image"
                                    src={imageUrl}
                                />
                            </div>
                        </div>
                    ) : null}

                    <div className="counter-contents-wrapper">
                        <attributes.counterTitleLevel className="eb-counter-number">
                            <span className="eb-counter-prefix">
                                {counterPrefix}
                            </span>
                            <span
                                className="eb-counter eb-counter-number"
                                data-duration={
                                    duration
                                        ? Math.floor(Math.abs(duration))
                                        : 0
                                }
                                data-startValue={
                                    startValue
                                        ? Math.floor(Math.abs(startValue))
                                        : 0
                                }
                                data-target={
                                    target ? Math.floor(Math.abs(target)) : 0
                                }
                                data-separator={separator}
                                data-isShowSeparator={isShowSeparator}
                            >
                                0
                            </span>
                            <span className="eb-counter-suffix">
                                {counterSuffix}
                            </span>
                        </attributes.counterTitleLevel>

                        <RichText.Content
                            tagName={titleLevel}
                            className="eb-counter-title"
                            value={counterTitle}
                        />
                    </div>
                </div>
            </div>
        </BlockProps.Save>
    );
};

export default Save;