@props([ 'actions' => [], 'badge' => null, 'badgeColor' => null, 'button' => false, 'color' => null, 'dropdownPlacement' => null, 'dynamicComponent' => null, 'group' => null, 'icon' => null, 'iconButton' => false, 'label' => null, 'link' => false, 'size' => null, 'tooltip' => null, 'view' => null, ]) @if (! ($dynamicComponent && $group)) @php $group = \Filament\Actions\ActionGroup::make($actions) ->badge($badge) ->badgeColor($badgeColor) ->color($color) ->dropdownPlacement($dropdownPlacement) ->icon($icon) ->label($label) ->size($size) ->tooltip($tooltip) ->view($view); if ($button) { $group->button(); } if ($iconButton) { $group->iconButton(); } if ($link) { $group->link(); } @endphp {{ $group }} @elseif (! $group->hasDropdown()) @foreach ($group->getActions() as $action) @if ($action->isVisible()) {{ $action }} @endif @endforeach @else @php $actionLists = []; $singleActions = []; foreach ($group->getActions() as $action) { if ($action->isHidden()) { continue; } if ($action instanceof \Filament\Actions\ActionGroup && (! $action->hasDropdown())) { if (count($singleActions)) { $actionLists[] = $singleActions; $singleActions = []; } $actionLists[] = array_filter( $action->getActions(), fn ($action): bool => $action->isVisible(), ); } else { $singleActions[] = $action; } } if (count($singleActions)) { $actionLists[] = $singleActions; } @endphp {{ $slot }} @foreach ($actionLists as $actions) @foreach ($actions as $action) {{ $action }} @endforeach @endforeach @endif