@php use Filament\Support\Enums\Alignment; use Filament\Support\Enums\IconSize; use Filament\Support\View\Components\SectionComponent\IconComponent; use function Filament\Support\is_slot_empty; @endphp @props([ 'afterHeader' => null, 'aside' => false, 'collapsed' => false, 'collapsible' => false, 'compact' => false, 'contained' => true, 'contentBefore' => false, 'description' => null, 'divided' => false, 'footer' => null, 'hasContentEl' => true, 'heading' => null, 'headingTag' => 'h2', 'icon' => null, 'iconColor' => 'gray', 'iconSize' => null, 'persistCollapsed' => false, 'secondary' => false, ]) @php if (filled($iconSize) && (! $iconSize instanceof IconSize)) { $iconSize = IconSize::tryFrom($iconSize) ?? $iconSize; } $hasDescription = filled((string) $description); $hasHeading = filled($heading); $hasIcon = filled($icon); $hasHeader = $hasIcon || $hasHeading || $hasDescription || $collapsible || (! is_slot_empty($afterHeader)); @endphp
class([ 'fi-section', 'fi-section-not-contained' => ! $contained, 'fi-section-has-content-before' => $contentBefore, 'fi-section-has-header' => $hasHeader, 'fi-aside' => $aside, 'fi-compact' => $compact, 'fi-collapsible' => $collapsible, 'fi-divided' => $divided, 'fi-secondary' => $secondary, ]) }} > @if ($hasHeader)
{{ \Filament\Support\generate_icon_html($icon, attributes: (new \Illuminate\View\ComponentAttributeBag) ->color(IconComponent::class, $iconColor), size: $iconSize ?? IconSize::Large) }} @if ($hasHeading || $hasDescription)
@if ($hasHeading) <{{ $headingTag }} class="fi-section-header-heading"> {{ $heading }} @endif @if ($hasDescription)

{{ $description }}

@endif
@endif @if (! is_slot_empty($afterHeader))
{{ $afterHeader }}
@endif @if ($collapsible) @endif
@endif
@if ($hasContentEl)
{{ $slot }}
@else {{ $slot }} @endif @if (! is_slot_empty($footer)) @endif