@props(['page' => null, 'blocks' => null]) {{-- The blocks of a page, drawn with the views of the types. `` reads the page; `:blocks="$blocks"` takes what `Blocks::for()` gave. A view of the site (resources/views/blocks/.blade.php) wins over the package's, a type without a view draws nothing. --}} @php $list = $blocks ?? ($page !== null ? \IriksIT\Manager\Support\Blocks::for((string) $page) : []); @endphp @foreach ($list as $block) @php($view = \IriksIT\Manager\Support\Blocks::view((string) $block['type'])) @if ($view !== null) @include($view, ['block' => $block, 'data' => $block['data'], 'style' => $block['style'], 'items' => $block['items'] ?? [], 'classes' => \IriksIT\Manager\Support\Blocks::classes($block['style'])]) @endif @endforeach