<?php
/**
 * @var $json string
 */


$table = new \Itguild\Tables\ListJsonTable($json);
$table->columns([
    'preview' => function ($data) {
        return "<img src='$data' width='200px'>";
    }
]);
$table->addAction(function ($row, $url){
    $active_admin_theme = \kernel\modules\option\service\OptionService::getItem('active_admin_theme');

    if ($row['path'] === $active_admin_theme){
        return "Активна";
    } else {
        $url = "$url/activate/?p=" . $row['path'];

        return \kernel\widgets\IconBtn\IconBtnActivateWidget::create(['url' => $url])->run();
    }
});
$table->create();
$table->render();