Implemented a block editor for changing the layout of the page

This commit is contained in:
2026-04-04 01:17:05 +02:00
parent 0800f7664f
commit ff58e82497
41 changed files with 2706 additions and 298 deletions

View File

@@ -0,0 +1,30 @@
@props(['block'])
@php
/** @var \App\Models\PageBlock $block */
$c = $block->content ?? [];
$size = (string) data_get($c, 'text_size', 'base');
$align = (string) data_get($c, 'text_alignment', 'center');
$sizeClass = match ($size) {
'sm' => 'text-sm sm:text-[15px]',
'lg' => 'text-lg sm:text-xl',
default => 'text-[15px] sm:text-base',
};
$alignClass = match ($align) {
'left' => 'text-left',
'right' => 'text-right',
default => 'text-center',
};
$bodyRaw = data_get($c, 'body');
$body = is_string($bodyRaw) ? trim($bodyRaw) : '';
@endphp
{{-- Body must be on one line inside the div: whitespace-pre-line turns indentation/newlines around {{ $body }} into visible gaps. --}}
<div class="w-full space-y-3" x-show="phase !== 'thanks'" x-cloak>
@if (filled(data_get($c, 'title')))
<h2 class="{{ $alignClass }} text-lg font-semibold text-white sm:text-xl">{{ data_get($c, 'title') }}</h2>
@endif
@if ($body !== '')
<div class="{{ $alignClass }} {{ $sizeClass }} whitespace-pre-line leading-relaxed text-white/90">{{ $body }}</div>
@endif
</div>