{{-- $index: Unique identifier for the section (e.g., existing ID or 'new_X') $section: LpPageSection instance (null for new sections) $sectionTypes: Array of available section types [key => Label] $availableLayouts: Array of available layouts [key => Label] (This needs to be passed to this partial) --}} @php $currentSection = $section ?? new \Modules\LandingPage\Entities\LpPageSection(); // Use a blank section for new items $isNew = !isset($section) || !$section->id; // Determine if it's a new section @endphp
{{-- Icon for visual cue --}} @if($section && $section->type) {{ $sectionTypes[$section->type] ?? Str::title(str_replace(['-', '_'], ' ', $section->type)) }} @if($section->title) - {{ $section->title }} @endif @else New Section @endif
title ?? '') }}" class="mt-1 block w-full rounded-md border-slate-300 dark:border-slate-600 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm dark:bg-slate-700 dark:text-slate-200" placeholder="e.g., Our Awesome Services">
{{-- Sort order is typically handled by the main page form or drag-and-drop, not per section item directly here --}} {{-- If you need sort_order per section, you can add it back, but ensure your LpPageSection model and controller handle it --}} {{--
sort_order : 0)) }}" class="mt-1 block w-full rounded-md border-slate-300 dark:border-slate-600 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm dark:bg-slate-700 dark:text-slate-200">
--}}
{{-- Content fields will be rendered here by JavaScript --}} @if($errors->has("sections.{$index}.content"))

Section content has errors.

@elseif($isNew || !$currentSection->type)

Select a section type to see its content fields.

@endif