Files
ladill-meet/resources/views/meet/admin/usage.blade.php
T
isaaccladandCursor 59b59cb70e
Deploy Ladill Meet / deploy (push) Successful in 54s
Bill Meet streaming hourly and storage per GB like Transfer.
Wallet debits at session end, on recording/file storage, and via daily renewals with grace period before asset deletion.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 16:33:45 +00:00

58 lines
3.7 KiB
PHP

<x-app-layout title="Usage & billing">
<div class="mx-auto max-w-2xl">
<h1 class="text-xl font-semibold text-slate-900">Usage & billing</h1>
<p class="mt-1 text-sm text-slate-600">{{ $organization->name }} · {{ ucfirst($tier) }} plan</p>
<div class="mt-6 rounded-2xl border border-slate-200 bg-white p-6">
<h2 class="font-medium text-slate-900">Pay-as-you-go rates</h2>
<ul class="mt-3 space-y-2 text-sm text-slate-600">
<li>Live meetings: <span class="font-medium text-slate-900">GHS {{ number_format($billing->pricePerHourGhs(), 2) }} / hour</span> (billed when a session ends)</li>
<li>Recordings & shared files: <span class="font-medium text-slate-900">GHS {{ number_format($billing->pricePerGbMonthGhs(), 2) }} / GB / month</span> (same as Ladill Transfer)</li>
</ul>
<p class="mt-3 text-xs text-slate-500">Charges debit your Ladill wallet. Storage renews monthly; unpaid items enter a {{ $billing->gracePeriodDays() }}-day grace period before deletion.</p>
</div>
<div class="mt-6 space-y-4">
@php
$rows = [
'streaming_hours' => ['label' => 'Streaming hours', 'used' => number_format($summary['streaming_hours'] ?? 0, 1), 'cost' => $costs['streaming'] ?? 0],
'recording_storage_bytes' => ['label' => 'Recording storage', 'used' => number_format(($summary['recording_storage_bytes'] ?? 0) / 1073741824, 2).' GB', 'cost' => $costs['recording_storage'] ?? 0],
'file_storage_bytes' => ['label' => 'Shared file storage', 'used' => number_format(($summary['file_storage_bytes'] ?? 0) / 1073741824, 2).' GB', 'cost' => $costs['file_storage'] ?? 0],
'ai_minutes' => ['label' => 'AI minutes', 'used' => number_format($summary['ai_minutes'] ?? 0), 'cost' => null],
];
@endphp
@foreach ($rows as $metric => $row)
@php
$limit = (int) ($quotas[$metric] ?? 0);
$pct = ($metric === 'streaming_hours' && $limit > 0)
? min(100, round((($summary['streaming_hours'] ?? 0) / $limit) * 100))
: (($metric !== 'streaming_hours' && $limit > 0)
? min(100, round(((int) ($summary[$metric] ?? 0) / $limit) * 100))
: 0);
@endphp
<div class="rounded-2xl border border-slate-200 bg-white p-6">
<div class="flex items-center justify-between gap-4">
<div>
<h2 class="font-medium text-slate-900">{{ $row['label'] }}</h2>
<p class="mt-1 text-sm text-slate-500">Last 30 days: {{ $row['used'] }}</p>
</div>
@if ($row['cost'] !== null)
<span class="text-sm font-medium text-slate-900">GHS {{ number_format($row['cost'], 2) }}</span>
@endif
</div>
@if ($limit > 0)
<div class="mt-3 flex items-center justify-between text-xs text-slate-500">
<span>Plan allowance</span>
<span>{{ $metric === 'streaming_hours' ? number_format($limit) : number_format($limit / 1073741824, 0).' GB' }}</span>
</div>
<div class="mt-2 h-2 overflow-hidden rounded-full bg-slate-100">
<div class="h-full rounded-full bg-indigo-500" style="width: {{ $pct }}%"></div>
</div>
@endif
</div>
@endforeach
</div>
</div>
</x-app-layout>