|
28 | 28 | <div class="bg-white dark:bg-gray-800 shadow overflow-hidden sm:rounded-md"> |
29 | 29 | <ul class="divide-y divide-gray-200 dark:divide-gray-700"> |
30 | 30 | @foreach($licenses as $license) |
31 | | - <li> |
32 | | - <a href="{{ route('customer.licenses.show', $license->key) }}" class="block hover:bg-gray-50 dark:hover:bg-gray-700"> |
| 31 | + @php |
| 32 | + $isLegacyLicense = $license->isLegacy(); |
| 33 | + $daysUntilExpiry = $license->expires_at ? $license->expires_at->diffInDays(now()) : null; |
| 34 | + $needsRenewal = $isLegacyLicense && $daysUntilExpiry !== null && $daysUntilExpiry <= 30 && !$license->expires_at->isPast(); |
| 35 | + @endphp |
| 36 | + <li class="{{ $needsRenewal ? 'bg-blue-50 dark:bg-blue-900/20' : '' }}"> |
| 37 | + <a href="{{ route('customer.licenses.show', $license->key) }}" class="block hover:bg-gray-50 dark:hover:bg-gray-700 {{ $needsRenewal ? 'hover:bg-blue-100 dark:hover:bg-blue-900/30' : '' }}"> |
33 | 38 | <div class="px-4 py-4 sm:px-6"> |
34 | 39 | <div class="flex items-center justify-between"> |
35 | 40 | <div class="flex items-center"> |
|
38 | 43 | <div class="w-3 h-3 bg-red-400 rounded-full"></div> |
39 | 44 | @elseif($license->expires_at && $license->expires_at->isPast()) |
40 | 45 | <div class="w-3 h-3 bg-yellow-400 rounded-full"></div> |
| 46 | + @elseif($needsRenewal) |
| 47 | + <div class="w-3 h-3 bg-blue-400 rounded-full animate-pulse"></div> |
41 | 48 | @else |
42 | 49 | <div class="w-3 h-3 bg-green-400 rounded-full"></div> |
43 | 50 | @endif |
44 | 51 | </div> |
45 | 52 | <div class="ml-4"> |
46 | | - <div class="flex items-center"> |
| 53 | + <div class="flex items-start"> |
47 | 54 | <div class="flex flex-col"> |
48 | 55 | @if($license->name) |
49 | 56 | <p class="text-sm font-medium text-blue-600 dark:text-blue-400 truncate"> |
|
66 | 73 | <span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200"> |
67 | 74 | Expired |
68 | 75 | </span> |
| 76 | + @elseif($needsRenewal) |
| 77 | + <span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"> |
| 78 | + Needs Renewal |
| 79 | + </span> |
69 | 80 | @else |
70 | 81 | <span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"> |
71 | 82 | Active |
|
78 | 89 | </div> |
79 | 90 | </div> |
80 | 91 | <div class="flex flex-col items-end"> |
81 | | - <p class="text-sm text-gray-900 dark:text-white"> |
82 | | - @if($license->expires_at) |
83 | | - Expires {{ $license->expires_at->format('M j, Y') }} |
84 | | - @else |
85 | | - No expiration |
| 92 | + @if($needsRenewal) |
| 93 | + <p class="text-sm font-medium text-blue-600 dark:text-blue-400"> |
| 94 | + Expires in {{ $daysUntilExpiry }} day{{ $daysUntilExpiry === 1 ? '' : 's' }} |
| 95 | + </p> |
| 96 | + |
| 97 | + @if($isLegacyLicense) |
| 98 | + <p class="text-xs text-blue-500 dark:text-blue-300"> |
| 99 | + Lock in Early Access Pricing |
| 100 | + </p> |
86 | 101 | @endif |
87 | | - </p> |
88 | | - <p class="text-xs text-gray-500 dark:text-gray-400"> |
89 | | - Created {{ $license->created_at->format('M j, Y') }} |
90 | | - </p> |
| 102 | + @else |
| 103 | + <p class="text-sm text-gray-900 dark:text-white"> |
| 104 | + @if($license->expires_at) |
| 105 | + Expires {{ $license->expires_at->format('M j, Y') }} |
| 106 | + @else |
| 107 | + No expiration |
| 108 | + @endif |
| 109 | + </p> |
| 110 | + <p class="text-xs text-gray-500 dark:text-gray-400"> |
| 111 | + Created {{ $license->created_at->format('M j, Y') }} |
| 112 | + </p> |
| 113 | + @endif |
91 | 114 | </div> |
92 | 115 | </div> |
93 | 116 | </div> |
|
0 commit comments