{extends file="admin-layout.tpl"}

{block name="no-return-functions"}
    {$admin_current_location = 'TheliaBlocks'}
{/block}

{block name="page-title"}{intl l='Thelia blocks'}{/block}

{block name="check-resource"}admin.content{/block}
{block name="check-access"}view{/block}

{block name="main-content"}
    <div id="thelia-blocks-root" class="thelia-blocks-ui"></div>
{/block}

{block name="javascript-last-call"}
    <script>
        {literal}
        let CONTAINER = document.getElementById('thelia-blocks-root');
        ReactDOM.render(React.createElement(TheliaBlocks.BlocksList, {
            containerId: "thelia-blocks-root",
            apiUrl: window.THELIA_BLOCKS_API_ROOT,
            isEditing: true,
            locales: window.THELIA_BLOCKS_LOCALES,
            urlPrefix: window.THELIA_BLOCKS_URL_PREFIX,
        }, null), CONTAINER)
        {/literal}
    </script>
{/block}
