127 lines
8.0 KiB
PHP
127 lines
8.0 KiB
PHP
<x-layouts::app :title="__('Platform')">
|
|
<div class="space-y-6">
|
|
<x-wms.page-hero
|
|
eyebrow="Platform"
|
|
title="Platform Dashboard"
|
|
description="System-level tenant, licensing, warehouse and pricing overview for MPBA administrators."
|
|
:stats="[
|
|
['label' => 'Companies', 'value' => $companiesCount, 'icon' => 'fa-solid fa-building'],
|
|
['label' => 'Active', 'value' => $activeCompaniesCount, 'icon' => 'fa-solid fa-circle-check'],
|
|
['label' => 'Prices', 'value' => $pricesCount, 'icon' => 'fa-solid fa-tags'],
|
|
]"
|
|
/>
|
|
<section class="grid gap-4 sm:grid-cols-2 xl:grid-cols-5">
|
|
@foreach ([['Companies', $companiesCount], ['Active', $activeCompaniesCount], ['Warehouses', $warehousesCount], ['Prices', $pricesCount], ['Licences', $licensesCount]] as [$label, $value])
|
|
<article class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-800 dark:bg-zinc-900">
|
|
<p class="text-sm text-zinc-500 dark:text-zinc-400">{{ $label }}</p>
|
|
<p class="mt-2 text-3xl font-bold text-zinc-900 dark:text-white">{{ $value }}</p>
|
|
</article>
|
|
@endforeach
|
|
</section>
|
|
|
|
<section class="rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-800 dark:bg-zinc-900">
|
|
<div class="flex flex-col gap-3 border-b border-zinc-200 p-5 sm:flex-row sm:items-center sm:justify-between dark:border-zinc-800">
|
|
<div>
|
|
<p class="text-xs font-bold uppercase tracking-[0.28em] text-cyan-500">Platform</p>
|
|
<h2 class="mt-2 text-xl font-bold text-zinc-900 dark:text-white">Pricing plans</h2>
|
|
<p class="text-sm text-zinc-500">Customer-facing Basic, Advanced and Pro plan cards shown under Platform.</p>
|
|
</div>
|
|
|
|
<div class="flex flex-wrap gap-2">
|
|
<a href="{{ route('platform.pricing.index') }}" wire:navigate class="rounded-xl border border-zinc-200 px-4 py-2 text-sm font-semibold text-zinc-700 hover:border-cyan-400 hover:text-cyan-700 dark:border-zinc-700 dark:text-zinc-200">
|
|
View pricing
|
|
</a>
|
|
<a href="{{ route('platform.prices.index') }}" wire:navigate class="rounded-xl bg-cyan-500 px-4 py-2 text-sm font-bold text-slate-950 hover:bg-cyan-400">
|
|
Manage prices
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-5 p-5 lg:grid-cols-3">
|
|
@forelse ($prices as $price)
|
|
@php
|
|
$isBasic = $price->code === 'basic';
|
|
$isAdvanced = $price->code === 'advanced';
|
|
$headerClass = $isAdvanced
|
|
? 'from-cyan-500 to-blue-600'
|
|
: ($isBasic ? 'from-slate-700 to-slate-950' : 'from-indigo-600 to-violet-700');
|
|
$features = array_slice($price->featureRows(), 0, 3);
|
|
@endphp
|
|
|
|
<article class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-800 dark:bg-zinc-950">
|
|
<div class="bg-gradient-to-br {{ $headerClass }} p-5 text-white">
|
|
<div class="flex items-start justify-between gap-4">
|
|
<div>
|
|
<p class="text-xs font-bold uppercase tracking-[0.24em] text-white/70">{{ $price->badge_label ?: 'Plan' }}</p>
|
|
<h3 class="mt-2 text-2xl font-black tracking-tight">{{ $price->name }}</h3>
|
|
</div>
|
|
<span class="grid h-11 w-11 place-items-center rounded-2xl bg-white/15 text-lg backdrop-blur">
|
|
<i class="fa-solid {{ $isBasic ? 'fa-box' : ($isAdvanced ? 'fa-layer-group' : 'fa-crown') }}" aria-hidden="true"></i>
|
|
</span>
|
|
</div>
|
|
<p class="mt-3 text-sm leading-6 text-white/80">{{ $price->strapline }}</p>
|
|
</div>
|
|
|
|
<div class="p-5">
|
|
<div class="flex items-end gap-2">
|
|
<span class="text-3xl font-black tracking-tight text-zinc-950 dark:text-white">{{ $price->formatAmount($price->monthly_amount) }}</span>
|
|
<span class="pb-1 text-xs font-semibold text-zinc-500">/ month</span>
|
|
</div>
|
|
<p class="mt-3 line-clamp-2 text-sm leading-6 text-zinc-600 dark:text-zinc-300">{{ $price->description }}</p>
|
|
|
|
<ul class="mt-4 space-y-2 text-sm text-zinc-700 dark:text-zinc-200">
|
|
@foreach ($features as $feature)
|
|
<li class="flex gap-3">
|
|
<i class="fa-solid fa-check mt-1 text-cyan-500" aria-hidden="true"></i>
|
|
<span>{{ $feature }}</span>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
</article>
|
|
@empty
|
|
<article class="rounded-2xl border border-dashed border-zinc-300 p-6 text-sm text-zinc-500 dark:border-zinc-700 lg:col-span-3">
|
|
No platform pricing plans have been published yet.
|
|
</article>
|
|
@endforelse
|
|
</div>
|
|
</section>
|
|
|
|
<section class="rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-800 dark:bg-zinc-900">
|
|
<div class="flex flex-col gap-3 border-b border-zinc-200 p-5 sm:flex-row sm:items-center sm:justify-between dark:border-zinc-800">
|
|
<div>
|
|
<h2 class="text-lg font-semibold text-zinc-900 dark:text-white">Recent companies</h2>
|
|
<p class="text-sm text-zinc-500">Tenant isolation is enforced by company ownership on every warehouse record.</p>
|
|
</div>
|
|
<a href="{{ route('platform.companies.index') }}" wire:navigate class="rounded-lg bg-zinc-900 px-4 py-2 text-sm font-semibold text-white dark:bg-white dark:text-zinc-900">
|
|
Manage companies
|
|
</a>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-800">
|
|
<thead class="bg-zinc-50 dark:bg-zinc-950">
|
|
<tr>
|
|
<th class="px-5 py-3 text-left font-semibold">Company</th>
|
|
<th class="px-5 py-3 text-left font-semibold">Users</th>
|
|
<th class="px-5 py-3 text-left font-semibold">Warehouses</th>
|
|
<th class="px-5 py-3 text-left font-semibold">Licences</th>
|
|
<th class="px-5 py-3 text-left font-semibold">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
@foreach ($companies as $company)
|
|
<tr>
|
|
<td class="px-5 py-4 font-medium">{{ $company->name }}</td>
|
|
<td class="px-5 py-4">{{ $company->users_count }}</td>
|
|
<td class="px-5 py-4">{{ $company->warehouses_count }}</td>
|
|
<td class="px-5 py-4">{{ $company->license_keys_count }}</td>
|
|
<td class="px-5 py-4">{{ $company->is_system_company ? 'System' : ucfirst($company->status) }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</x-layouts::app>
|