<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>

<div class="dashboard-container row">
    <div class="dashboard-main col-m-8 col-m-push-4">
        <div class="dashboard-diagram-container">
            <?= $block->getChildHtml('chartDisabled') ?>
            <?= $block->getChildHtml('diagrams') ?>
            <?php
                $diagramsBlock = $block->getChildBlock('diagrams');
                $tabsIds = $diagramsBlock ? $diagramsBlock->getTabsIds() : [];
            ?>
            <?php if (is_array($tabsIds)): ?>
                <?= $block->getChildHtml('diagramsPeriod') ?>
                <div id="diagram_tab_content" class="dashboard-diagram-tab-content"></div>
            <?php endif; ?>
        </div>
        <?= $block->getChildHtml('totals') ?>
        <div class="dashboard-store-stats">
            <?= $block->getChildHtml('grids') ?>
            <div id="grid_tab_content" class="dashboard-store-stats-content"></div>
            <?= $block->getChildHtml('refresh_statistics') ?>
        </div>
    </div>
    <div class="dashboard-secondary col-m-4 col-m-pull-8">
        <?= $block->getChildHtml('sales') ?>
        <div class="dashboard-item">
            <div class="dashboard-item-title"><?= $block->escapeHtml(__('Last Orders')) ?></div>
            <?php //echo  $block->getChildHtml('lastOrders') ?>
            <?php echo $block->getLayout()->createBlock('Magetop\Advancepreview\Block\Adminhtml\CustomOrders')->setTemplate('Magetop_Advancepreview::dashboard/custom_order_items.phtml')->toHtml();
            ?>
        </div>
        <div class="dashboard-item">
            <div class="dashboard-item-title"><?= $block->escapeHtml(__('Last Search Terms')) ?></div>
            <?= $block->getChildHtml('lastSearches') ?>
        </div>
        <div class="dashboard-item">
            <div class="dashboard-item-title"><?= $block->escapeHtml(__('Top Search Terms')) ?></div>
            <?= $block->getChildHtml('topSearches') ?>
        </div>
    </div>
</div>
