|
9 | 9 | <flux:table.columns> |
10 | 10 | <flux:table.column>License</flux:table.column> |
11 | 11 | <flux:table.column>Key</flux:table.column> |
12 | | - <flux:table.column>Status</flux:table.column> |
13 | | - <flux:table.column>Expires</flux:table.column> |
14 | 12 | </flux:table.columns> |
15 | 13 |
|
16 | 14 | <flux:table.rows> |
17 | 15 | @foreach($this->licenses as $license) |
18 | | - @php |
19 | | - $isLegacyLicense = $license->isLegacy(); |
20 | | - $daysUntilExpiry = $license->expires_at ? (int) now()->diffInDays($license->expires_at, false) : null; |
21 | | - $needsRenewal = $isLegacyLicense && $daysUntilExpiry !== null && !$license->expires_at->isPast(); |
22 | | -
|
23 | | - $status = match(true) { |
24 | | - $license->is_suspended => 'Suspended', |
25 | | - $license->expires_at && $license->expires_at->isPast() => 'Expired', |
26 | | - $needsRenewal => 'Needs Renewal', |
27 | | - default => 'Active', |
28 | | - }; |
29 | | - @endphp |
30 | 16 | <flux:table.row :key="$license->id"> |
31 | 17 | <flux:table.cell> |
32 | 18 | <div> |
|
42 | 28 | <flux:table.cell> |
43 | 29 | <x-customer.masked-key :key-value="$license->key" /> |
44 | 30 | </flux:table.cell> |
45 | | - |
46 | | - <flux:table.cell> |
47 | | - <x-customer.status-badge :status="$status" /> |
48 | | - </flux:table.cell> |
49 | | - |
50 | | - <flux:table.cell> |
51 | | - @if($needsRenewal) |
52 | | - <div> |
53 | | - <span class="font-medium text-blue-600 dark:text-blue-400"> |
54 | | - {{ $daysUntilExpiry }} day{{ $daysUntilExpiry === 1 ? '' : 's' }} |
55 | | - </span> |
56 | | - @if($isLegacyLicense) |
57 | | - <flux:text class="text-xs text-blue-500 dark:text-blue-300">Lock in Early Access Pricing</flux:text> |
58 | | - @endif |
59 | | - </div> |
60 | | - @elseif($license->expires_at) |
61 | | - <div> |
62 | | - {{ $license->expires_at->format('M j, Y') }} |
63 | | - @if($license->expires_at->isPast()) |
64 | | - <flux:text class="text-xs">Expired {{ $license->expires_at->diffForHumans() }}</flux:text> |
65 | | - @endif |
66 | | - </div> |
67 | | - @else |
68 | | - No expiration |
69 | | - @endif |
70 | | - </flux:table.cell> |
71 | 31 | </flux:table.row> |
72 | 32 | @endforeach |
73 | 33 | </flux:table.rows> |
|
82 | 42 | <flux:table.columns> |
83 | 43 | <flux:table.column>License</flux:table.column> |
84 | 44 | <flux:table.column>Key</flux:table.column> |
85 | | - <flux:table.column>Status</flux:table.column> |
86 | | - <flux:table.column>Expires</flux:table.column> |
87 | 45 | </flux:table.columns> |
88 | 46 |
|
89 | 47 | <flux:table.rows> |
90 | 48 | @foreach($this->assignedSubLicenses as $subLicense) |
91 | | - @php |
92 | | - $subStatus = match(true) { |
93 | | - $subLicense->is_suspended => 'Suspended', |
94 | | - $subLicense->expires_at && $subLicense->expires_at->isPast() => 'Expired', |
95 | | - default => 'Active', |
96 | | - }; |
97 | | - @endphp |
98 | 49 | <flux:table.row :key="$subLicense->id"> |
99 | 50 | <flux:table.cell> |
100 | 51 | <div> |
|
106 | 57 | <flux:table.cell> |
107 | 58 | <x-customer.masked-key :key-value="$subLicense->key" /> |
108 | 59 | </flux:table.cell> |
109 | | - |
110 | | - <flux:table.cell> |
111 | | - <x-customer.status-badge :status="$subStatus" /> |
112 | | - </flux:table.cell> |
113 | | - |
114 | | - <flux:table.cell> |
115 | | - @if($subLicense->expires_at) |
116 | | - <div> |
117 | | - {{ $subLicense->expires_at->format('M j, Y') }} |
118 | | - @if($subLicense->expires_at->isPast()) |
119 | | - <flux:text class="text-xs">Expired {{ $subLicense->expires_at->diffForHumans() }}</flux:text> |
120 | | - @endif |
121 | | - </div> |
122 | | - @else |
123 | | - No expiration |
124 | | - @endif |
125 | | - </flux:table.cell> |
126 | 60 | </flux:table.row> |
127 | 61 | @endforeach |
128 | 62 | </flux:table.rows> |
|
0 commit comments