{{-- Activity Timeline Widget Props: $activities – array of { user, action, target?, time, icon?, color? } $title – widget title $limit – max items to show (0 = all) Usage: --}} @props([ 'activities' => [], 'title' => 'Recent Activity', 'limit' => 0, ]) @php $items = $limit > 0 ? array_slice((array)$activities, 0, $limit) : (array)$activities; $colorMap = [ 'create' => 'bg-green-100 text-green-600 dark:bg-green-950 dark:text-green-400', 'update' => 'bg-blue-100 text-blue-600 dark:bg-blue-950 dark:text-blue-400', 'delete' => 'bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400', 'login' => 'bg-primary-100 text-primary-600 dark:bg-primary-950 dark:text-primary-400', 'default'=> 'bg-surface-100 text-surface-600 dark:bg-surface-800 dark:text-surface-400', ]; @endphp

{{ $title }}

@if(empty($items)) @else
    @foreach($items as $activity) @php $colorKey = $activity['color'] ?? 'default'; $iconClass = $colorMap[$colorKey] ?? $colorMap['default']; @endphp
  1. @if(isset($activity['icon'])) {!! $activity['icon'] !!} @else {{ strtoupper(substr($activity['user'] ?? '?', 0, 1)) }} @endif

    {{ $activity['user'] ?? 'System' }} {{ $activity['action'] ?? '' }} @if(isset($activity['target'])) {{ $activity['target'] }} @endif

    {{ $activity['time'] ?? '' }}

  2. @endforeach
@endif
@if(isset($footer))
{{ $footer }}
@endif