<?php
/**@var \Magetop\Advancepreview\Block\Adminhtml\Product\Edit\Form $block */
$productId = $block->getRequest()->getParam('product_id',0);
$previews = $block->getPreviewByProductId($productId);
//print_r($previews->getData());
?>
<table style="width:100%" id="table-product-review-list">
    <tr>
        <th><?php echo __('Title') ?></th>
        <th><?php echo __('Created At') ?></th>
        <th><?php echo __('Edit') ?></th>
        <th><?php echo __('Delete') ?></th>
    </tr>
    <?php foreach ($previews as $preview) : ?>
    <tr>
        <td><?php echo $preview->getData('title') ?></td>
        <td><?php echo $preview->getData('created_at') ?></td>
        <td><span class="preview-item-edit" preview-id="<?php echo $preview->getId(); ?>"><?php echo __('Edit') ?></span></td>
        <td><span class="preview-item-delete" preview-id="<?php echo $preview->getId(); ?>"><?php echo __('Delete') ?></span></td>
    </tr>
    <?php endforeach; ?>
</table>
