{{-- Header --}}
{{ $title }}
{{-- Add Project Source --}} @if(Auth::user()->is_bo || Auth::user()->is_any_partner_role) @endif
{{-- Filters Panel --}} {{--
@if(Auth::user()->is_bo)
@endif
--}} {{-- Main Content --}}
{{-- Stats Cards --}}
{{-- Total Sources Card --}}
{{ __('Total Origins') }}
{{ number_format($this->stats['total']) }} {{ __('origins') }}
{{-- Active Sources Card --}}
{{ __('Active') }}
{{ number_format($this->stats['active']) }} {{ $this->stats['total'] > 0 ? round(($this->stats['active'] / $this->stats['total']) * 100) : 0 }}%
{{-- Inactive Sources Card --}}
{{ __('Inactive') }}
{{ number_format($this->stats['inactive']) }} {{ $this->stats['total'] > 0 ? round(($this->stats['inactive'] / $this->stats['total']) * 100) : 0 }}%
{{-- My Sources Card --}}
{{ __('My Origins') }}
{{ number_format($this->stats['my_sources']) }} {{ __('created') }}
@if(Auth::user()->is_any_partner_role) {{-- Assigned to Me Card --}} {{--
{{ __('Assigned to Me') }}
{{ number_format($this->stats['assigned_to_me']) }} {{ __('assigned') }}
--}} @endif
{{-- Usage Chart --}} {{--
{{ __('Most Used Project Sources') }}
@if(count($this->usageStats) > 0)
@foreach($this->usageStats as $source)
{{ $source['name'] }}
{{ number_format($source['total_projects']) }} {{ __('projects') }}
@php $maxUsage = collect($this->usageStats)->max('total_projects'); $percentage = $maxUsage > 0 ? ($source['total_projects'] / $maxUsage) * 100 : 0; @endphp
@endforeach
@else

{{ __('No usage data available') }}

@endif
--}} {{-- Project Sources List --}}
{{ __('Project Origins List') }}
@livewire('project-sources.project-sources-table', ['title' => ''])
{{-- Recent Activity --}}
{{-- Statistics Section --}}
{{ __('Usage Statistics') }}
@if(count($this->categoryBreakdown) > 0)
{{-- Usage by Category --}}
{{ __('Usage by Project Category') }}
@foreach($this->categoryBreakdown as $breakdown)
{{ $breakdown['source_name'] }}
{{ __('Total Projects') }}: {{ number_format($breakdown['total_projects']) }}
@foreach($breakdown['categories'] as $category)
{{ $category['category_name'] }} {{ number_format($category['project_count']) }}
@endforeach
@endforeach
{{-- Performance Metrics --}}
{{ __('Performance Metrics') }}
{{ number_format($this->stats['total']) }}
{{ __('Total Origins') }}
{{ __('Available project sources') }}
{{ $this->stats['total'] > 0 ? round(($this->stats['active'] / $this->stats['total']) * 100) : 0 }}%
{{ __('Active Rate') }}
{{ __('Active origins vs total') }}
@php $avgUsage = collect($this->usageStats)->avg('total_projects') ?? 0; @endphp
{{ number_format($avgUsage, 1) }}
{{ __('Avg Usage') }}
{{ __('Average projects per origin') }}
@else
{{ __('No statistics data available') }}

{{ __('Create some project origins and assign them to projects to see usage statistics.') }}

@endif
{{-- Custom Styles --}}