@extends('layouts.admin')
@section('title', 'Customers')
@section('heading', 'Customers')
@section('subheading', $customers->total() . ' ' . Str::plural('customer', $customers->total()) . ($isFiltered ? ' matching your filters' : ''))
@section('header-actions')
New Customer
@endsection
@section('content')
@php
// Share-of-total lines for the cards. Derived from the counts already
// fetched - no extra queries, and no figure that is not in the data.
$share = fn (int $n) => $stats['total'] > 0 ? round($n / $stats['total'] * 100) . '% of customers' : 'No customers yet';
@endphp
{{-- lg:h-full is what removes the dead space: the page becomes exactly the
height of the viewport and the grid takes whatever the cards and filters
leave, so the table fills the screen and scrolls inside itself instead of
ending halfway down. Below lg the page scrolls normally. --}}