@php use App\Enums\ComponentType; @endphp @extends('backend.layouts.app') @section('title', __('Page Component')) @push('styles') @endpush @push('scripts') @endpush @section('content') @php $totalComponents = $components->count(); $activeComponents = $components->where('is_active', true)->count(); $dynamicComponents = $components->filter(fn ($component) => $component->type === ComponentType::Dynamic)->count(); $staticComponents = $totalComponents - $dynamicComponents; $protectedComponents = $components->where('is_protected', true)->count(); $activeRatio = $totalComponents > 0 ? (int) round(($activeComponents / $totalComponents) * 100) : 0; $canManageComponents = app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('component-manage'); @endphp
@if($canManageComponents) {{ __('Add New Component') }} @endif
{{ __('Component Workspace') }}

{{ __('Page Component Library') }}

{{ __('Manage reusable blocks from one compact library.') }}

{{ $totalComponents }}{{ __('Blocks') }} {{ $staticComponents }}{{ __('Static') }} {{ $dynamicComponents }}{{ __('Dynamic') }}
{{ __('Library Status') }}

{{ $activeRatio }}%

{{ __('Ready') }}

{{ __('Track active, protected, and reusable block health at a glance.') }}

{{ __('Active') }} {{ $activeComponents }}
{{ __('Protected') }} {{ $protectedComponents }}

{{ __('Component Catalog') }}

{{ __('Search, inspect, and manage every reusable block without leaving the component workspace.') }}

{{ __('Visible') }} {{ $totalComponents }}
@if($canManageComponents) @endif @forelse($components as $component) @php $isDynamic = $component->type === ComponentType::Dynamic; $searchTokens = strtolower(implode(' ', array_filter([ $component->component_name, $component->component_key, $component->type->value, $component->is_active ? 'active' : 'inactive', $component->is_protected ? 'protected' : 'editable', ]))); @endphp @if($canManageComponents) @endif @empty @endforelse @if($components->isNotEmpty()) @endif
{{ __('Component') }} {{ __('Type') }} {{ __('Status') }}{{ __('Action') }}
@include('backend.page_component.partials._component_icon', [ 'component' => $component, 'wrapperClass' => 'pc-component-thumb component-admin-thumb--lg', ])
{{ $component->component_name }}
{{ __('Key') }} {{ $component->component_key }}
$isDynamic, 'pc-type-badge--static' => ! $isDynamic, ])> {{ $isDynamic ? __('Dynamic') : __('Static') }}
$component->is_active, 'pc-status-pill--danger' => ! $component->is_active, ])> {{ $component->is_active ? __('Active') : __('Inactive') }} $component->is_protected, 'pc-status-pill--neutral' => ! $component->is_protected, ])> {{ $component->is_protected ? __('Protected') : __('Editable') }}
@unless($component->is_protected) {{ __('Manage') }} @else {{ __('Protected') }} @endunless @if($isDynamic) {{ __('Delete') }} @else {{ __('System Asset') }} @endif
@endsection