@extends('admin.layouts.app') @section('title', $title) @section('content')
{{-- Header --}}

Module Marketplace

Browse and purchase ChargePanda modules.
@csrf
{{-- Catalog error states --}} @if($catalogStatus === 'missing-license')
License key not configured. Add your ChargePanda license key in Settings to browse available modules.
@elseif($catalogStatus === 'error')
Could not reach the module catalog. Showing cached data if available.
@csrf .
@endif @if($modules->isEmpty())

No modules available in the catalog yet.

@else {{-- Legend --}}
Installed Update Available Purchased Free Not Owned Support Expired
@foreach($modules as $module)
{{-- Module header --}}
{{ $module['name'] }} @if($module['latest_version']) v{{ $module['latest_version'] }} @endif
@switch($module['state']) @case('installed_active') Installed @break @case('installed_inactive') Inactive @break @case('update_available') Update Available @break @case('purchased_available') Purchased @break @case('free_available') Free @break @case('support_expired') Support Expired @break @default @if($module['price'] > 0) ${{ number_format($module['price'], 0) }} @else Free @endif @endswitch
{{-- Description --}} @if($module['description'])

{{ \Illuminate\Support\Str::limit($module['description'], 100) }}

@endif {{-- Installed version info --}} @if($module['is_installed']) Installed: v{{ $module['installed_version'] }} @if($module['update_available']) → v{{ $module['latest_version'] }} @endif @endif {{-- Support expiry info --}} @if($module['support_expires_at'] && in_array($module['state'], ['installed_active','purchased_available','update_available'])) Support until {{ \Carbon\Carbon::parse($module['support_expires_at'])->format('d M Y') }} @endif {{-- Action button --}}
@switch($module['state']) @case('not_owned') Buy — ${{ number_format($module['price'], 0) }} @break @case('free_available') @case('purchased_available') Get on ChargePanda @break @case('installed_active') Manage @break @case('installed_inactive') @if($module['module_id'])
@csrf @method('PATCH')
@endif @break @case('update_available') @if($module['module_id'] && $module['download_url']) @else Check Updates @endif @break @case('support_expired') Renew Support @break @endswitch
@endforeach
@endif
{{-- Apply update modal --}} @endsection @push('scripts') @endpush