{{ t('dashboard') }} {{-- ══ Widget Options Panel ══ --}}
{{-- Panel title --}}

{{ t('widgets') }}

|
{{-- Widget list --}} @php $tenantWidgets = [ 'stats' => t('usage_limits'), 'audience_growth' => t('audience_growth'), 'contact_sources' => t('contact_sources'), 'weekly_messages' => t('weekly_message_volume'), 'campaign_statistics' => t('campaign_statistic'), ]; @endphp
    @foreach ($tenantWidgets as $key => $label) @php $visible = $widgetVisibility[$key] ?? true; @endphp
  • @endforeach
{{-- ══ Dashboard Options button ══ --}}
{{-- Hooks --}}
@php do_action('before_tenant_dashboard_content') @endphp
{{-- Conversation limit alert --}} @if ($conversationLimit != -1 && $totalConversations >= $conversationLimit)

{{ t('conversation_limit_reached') }}!

{{ t('conversation_limit_upgrade_message') }}.

  • {{ t('campaign_sending_paused') }}
  • {{ t('chat_reinitialization_disabled') }}
  • {{ t('new_conversation_blocked_until_limit_reset') }}
@endif {{-- Template change alert --}} @if (get_tenant_setting_from_db('whats-mark', 'is_templates_changed', '0') == '1')

{{ t('whatsapp_template_status_change_detected') }}

{{ t('we_have_received') }} {{ t('webhook_events_from_meta') }} {{ t('whatsapp_messsage_template_changed_alert') }}

{{ t('warning_point_1') }}
{{ t('warning_point_2') }}
{{ t('warning_point_3') }}
@endif {{-- Dashboard Header --}}

{{ t('hello') }} {{ $tenantUser ? $tenantUser->firstname . ' ' . $tenantUser->lastname : t('user') }},

{{ t('empower_your_business') }} {{ $appName }}

{{ $planName }}

@if ($activeSubscription && $activeSubscription->plan->billing_period === 'lifetime') {{ t('lifetime') }} @elseif ($nextBillingDate) @if ($activeSubscription && $activeSubscription->status === 'trial') {{ t('trial_ends') . ': ' . $nextBillingDate }} @if ($daysUntilBilling !== null) ({{ $daysUntilBilling > 0 ? $daysUntilBilling . ' ' . t('days_left') : t('expired') }}) @endif @else {{ t('next_billing') }} {{ $nextBillingDate }} @if ($daysUntilBilling !== null && $daysUntilBilling > 0) ({{ $daysUntilBilling }} {{ t('days') }}) @endif @endif @else {{ $subscriptionMessage ?? t('no_active_subscription') }} @endif

{{-- ══ Widget Map & Layout ══ --}} @php $containerLayout = [ 'top-12' => 'col-span-12', 'left-8' => 'col-span-12 lg:col-span-8', 'right-4' => 'col-span-12 lg:col-span-4', 'half-left' => 'col-span-12 lg:col-span-6', 'half-right' => 'col-span-12 lg:col-span-6', ]; $tenantWidgetMap = [ 'stats' => ['name' => t('usage_limits')], 'audience_growth' => ['name' => t('audience_growth')], 'contact_sources' => ['name' => t('contact_sources')], 'weekly_messages' => ['name' => t('weekly_message_volume')], 'campaign_statistics' => ['name' => t('campaign_statistic')], ]; @endphp {{-- ══ Visible widget grid ══ --}}
@foreach ($containerLayout as $containerName => $colClass) @php $hasVisible = collect($widgetOrder[$containerName] ?? [])->contains( fn($id) => isset($tenantWidgetMap[$id]) && ($widgetVisibility[$id] ?? true), ); @endphp @if ($hasVisible)
@foreach ($widgetOrder[$containerName] ?? [] as $widgetId) @php $widget = $tenantWidgetMap[$widgetId] ?? null; $visible = $widget && ($widgetVisibility[$widgetId] ?? true); @endphp @if ($widget && $visible)
{{-- Drag handle --}}

{{ $widget['name'] }}

{{-- Audience Growth chart mode toggle --}} @if ($widgetId === 'audience_growth')
@endif {{-- Campaign Statistics chart type toggle --}} @if ($widgetId === 'campaign_statistics')
@endif {{-- Hide button --}}
@switch($widgetId) {{-- ── Stats ── --}} @case('stats')
{{ do_action('after_dashboard_stats_card') }}
@break {{-- ── Audience Growth ── --}} @case('audience_growth')
@break {{-- ── Contact Sources ── --}} @case('contact_sources')
@break {{-- ── Weekly Messages ── --}} @case('weekly_messages')
@break {{-- ── Campaign Statistics ── --}} @case('campaign_statistics')
@break @endswitch
@endif @endforeach
@endif @endforeach
{{-- end #tenant-widget-grid --}} {{-- ══ Placeholder grid — shown when widgets area is hidden ══ --}}
@foreach ($containerLayout as $containerName => $colClass) @php $containerWidgets = collect($widgetOrder[$containerName] ?? []) ->filter(fn($id) => isset($tenantWidgetMap[$id])) ->values(); @endphp @if ($containerWidgets->isNotEmpty())
@foreach ($containerWidgets as $widgetId)
@endforeach
@endif @endforeach
{{-- end root x-data --}}