<div class="list-preview list-flush" style="margin-left: -20px; margin-right: -20px; border-right: 0; border-left: 0;">
    <div class="control-list">
        <table class="table data" data-control="rowlink">
            <thead>
            <tr>
                <th><span><?= e(trans('offline.mall::lang.custom_field_options.option')) ?></span></th>
                <th><span><?= e(trans('offline.mall::lang.product.price')) ?></span></th>
                <th style="width: 10%"><span></span></th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($items as $item): ?>
            <tr class="rowlink">
                <td>
                    <a href="javascript:;"
                       data-handler="onLoadEditOptionForm"
                       data-size="large"
                       data-request-data="option_id: '<?= $item->id ?>', type: '<?php echo $type; ?>'"
                       data-control="popup">
                        <?= e($item->name) ?>
                    </a>
                </td>
                <td>
                    <?= $item->price()->integer !== null ? e((string)$item->price()) : '' ?>
                </td>
                <td class="nolink text-right">
                    <a
                            href="javascript:;"
                            data-request="onDeleteOption"
                            data-request-data="record_id: '<?= $item->id ?>'"
                            data-request-confirm="Delete this item?"
                            class="oc-icon-remove"
                            data-toggle="tooltip"
                            title="Remove"></a>
                </td>
            </tr>
            <?php endforeach ?>

            <tr>
                <td class="column-button nolink" colspan="3" style="background: #fafafa; border-top: 2px solid #eee;">
                    <a
                            href="javascript:;"
                            class="btn btn-sm btn-secondary oc-icon-plus js-create-option-form"
                            data-control="popup"
                            data-handler="onLoadCreateOptionForm"
                            data-request-data="type: '<?php echo $type ?>'"
                            data-size="large">
                        <?= e(trans('offline.mall::lang.common.add_value')) ?>
                    </a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<script>
    $(function () {
        $('body').trigger('oc-mall.custom-field-options.reloaded')
    })
</script>