// import { useBlockProps } from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';

import './editor.scss';

export default function Save({ attributes }) {
    // const blockProps = useBlockProps.save();
    const steps = attributes.steps || [];
    const redirectURL = attributes.redirectURL || "";
    const position = attributes.position || "in_content";

    const htmlTagsEntities = (str) => {
        return String(str).replace(/</g, '&lt;').replace(/>/g, '&gt;');
    };

    return "[seoaic_multistep_form position=\"" + position + "\" redirecturl=\"" + redirectURL + "\"]" + htmlTagsEntities(JSON.stringify(steps)) + "[/seoaic_multistep_form]";
}