Files
ladill-give/resources/views/give/dashboard.blade.php
T
isaacclad 8058362bf4
Deploy Ladill Give / deploy (push) Successful in 38s
Use mobile icon buttons on Give and QR dashboards.
Add header create action and sync mobile notification badge partial.
2026-07-03 22:41:00 +00:00

76 lines
4.8 KiB
PHP

<x-user-layout>
<x-slot name="title">Overview</x-slot>
@php $fmt = fn ($m) => 'GHS '.number_format($m / 100, 2); @endphp
<div class="space-y-6">
<div class="flex items-center justify-between gap-3">
<div class="min-w-0 flex-1">
<h1 class="truncate text-lg font-semibold text-slate-900 lg:text-xl">Overview</h1>
<p class="mt-1 hidden text-sm text-slate-500 sm:block">Total raised today, active giving pages, and recent donations.</p>
</div>
@include('partials.mobile-header-btn', [
'href' => route('give.giving-pages.create'),
'label' => 'New giving page',
'variant' => 'indigo',
])
</div>
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
<div class="rounded-2xl border border-slate-200 bg-white p-5">
<p class="text-xs font-medium uppercase tracking-wide text-slate-400">Raised today</p>
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ $fmt($todayMinor) }}</p>
</div>
<div class="rounded-2xl border border-slate-200 bg-white p-5">
<p class="text-xs font-medium uppercase tracking-wide text-slate-400">Donations today</p>
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ number_format($todayCount) }}</p>
</div>
<div class="rounded-2xl border border-slate-200 bg-white p-5">
<p class="text-xs font-medium uppercase tracking-wide text-slate-400">Giving pages</p>
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ $givingPageCount }}</p>
</div>
<div class="rounded-2xl border border-indigo-100 bg-indigo-50/60 p-5">
<p class="text-xs font-medium uppercase tracking-wide text-indigo-600">Wallet balance</p>
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ $fmt($balanceMinor) }}</p>
</div>
</div>
<div class="grid gap-4 lg:grid-cols-2">
<div class="rounded-2xl border border-slate-200 bg-white">
<div class="flex items-center justify-between border-b border-slate-100 px-6 py-4">
<h2 class="font-semibold text-slate-900">Recent donations</h2>
<a href="{{ route('give.donations.index') }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">View all</a>
</div>
@if($recentDonations->isEmpty())
<p class="px-6 py-8 text-sm text-slate-500">No donations yet. Create a giving page and share your QR.</p>
@else
<div class="divide-y divide-slate-100">
@foreach($recentDonations as $donation)
<div class="flex items-center justify-between px-6 py-4">
<div>
<p class="font-medium text-slate-900">{{ $donation->payer_name ?: 'Anonymous donor' }}</p>
<p class="text-xs text-slate-500">{{ $donation->collection_type ?: 'Donation' }} · {{ $donation->qrCode?->label }} · {{ $donation->paid_at?->diffForHumans() }}</p>
</div>
<span class="text-sm font-semibold text-emerald-700">{{ $fmt($donation->merchant_amount_minor) }}</span>
</div>
@endforeach
</div>
@endif
</div>
<div class="rounded-2xl border border-slate-200 bg-white p-6">
<h2 class="font-semibold text-slate-900">Quick links</h2>
<div class="mt-4 space-y-3">
<a href="{{ route('give.giving-pages.create') }}" class="flex items-center justify-between rounded-xl border border-slate-100 px-4 py-3 text-sm hover:bg-slate-50">
<span class="font-medium text-slate-700">Create giving page</span>
<span class="text-slate-400"></span>
</a>
<a href="{{ route('give.giving-pages.index') }}" class="flex items-center justify-between rounded-xl border border-slate-100 px-4 py-3 text-sm hover:bg-slate-50">
<span class="font-medium text-slate-700">All giving pages</span>
<span class="text-slate-400"></span>
</a>
<a href="{{ route('give.payouts') }}" class="flex items-center justify-between rounded-xl border border-slate-100 px-4 py-3 text-sm hover:bg-slate-50">
<span class="font-medium text-slate-700">Payouts & withdrawals</span>
<span class="text-slate-400"></span>
</a>
</div>
</div>
</div>
</div>
</x-user-layout>