@@ -137,11 +137,11 @@ class="isolate mt-2 grid grid-cols-7 gap-px rounded-lg bg-gray-200 text-sm shado
137137 $isLastCell = $cellIndex === $firstDayOfWeek - 1 + $daysInMonth ;
138138 @endphp
139139
140- <button type =" button"
140+ <button type =" button" wire:click = " showDueItems(' {{ $formattedDate } } ') "
141141 class =" bg-white py-1.5 hover:bg-gray-100 focus:z-10 {{ $isFirstCell ? ' rounded-tl-lg' : ' ' } } {{ $isLastCell ? ' rounded-br-lg' : ' ' } }" >
142142 <time datetime =" {{ $formattedDate } }"
143143 title =" {{ $hasDue ? implode (' , ' , collect ($dueDatesByDay [$formattedDate ])-> pluck (' category.name' )-> toArray ()) : ' ' } }"
144- class =" mx-auto flex size-7 items-center justify-center rounded-full {{ $hasDue ? ' bg-indigo-600 font-semibold text-white' : ' ' } }" >
144+ class =" mx-auto flex size-7 items-center justify-center rounded-full {{ $hasDue ? ' bg-indigo-600 font-semibold text-white cursor-pointer ' : ' ' } }" >
145145 {{ $day } }
146146 </time >
147147 </button >
@@ -150,6 +150,49 @@ class="mx-auto flex size-7 items-center justify-center rounded-full {{ $hasDue ?
150150 </section >
151151 @endforeach
152152
153+ @if ($selectedDate && count ($selectedDueItems ) )
154+ <div class =" fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50"
155+ x-transition:enter =" transition ease-out duration-300" x-transition:enter-start =" opacity-0"
156+ x-transition:enter-end =" opacity-100" x-transition:leave =" transition ease-in duration-200"
157+ x-transition:leave-start =" opacity-100" x-transition:leave-end =" opacity-0" >
158+ <div class =" bg-white rounded-lg shadow-lg w-full max-w-2xl p-6 relative" >
159+ <button wire:click =" $set('selectedDate', null)"
160+ wire:keydown.escape.window =" $set('selectedDate', null)"
161+ class =" absolute top-2 right-2 text-gray-400 hover:text-gray-600" >
162+ <svg xmlns =" http://www.w3.org/2000/svg" class =" h-5 w-5" fill =" none"
163+ viewBox =" 0 0 24 24" stroke =" currentColor" >
164+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2"
165+ d =" M6 18L18 6M6 6l12 12" />
166+ </svg >
167+ </button >
168+
169+ <h2 class =" text-lg font-semibold mb-4" >Due on
170+ {{ \Carbon \Carbon:: parse ($selectedDate )-> format (' jS F, Y' ) } } </h2 >
171+
172+ <table class =" min-w-full text-sm text-left border" >
173+ <thead class =" bg-gray-100" >
174+ <tr >
175+ <th class =" px-4 py-2 border-b" >Category</th >
176+ <th class =" px-4 py-2 border-b" >Provider</th >
177+ <th class =" px-4 py-2 border-b" >Amount</th >
178+ </tr >
179+ </thead >
180+ <tbody >
181+ @foreach ($selectedDueItems as $item )
182+ <tr >
183+ <td class =" px-4 py-2 border-b" >{{ $item -> category -> name ?? ' -' } } </td >
184+ <td class =" px-4 py-2 border-b" >{{ $item -> provider -> name ?? ' -' } } </td >
185+ <td class =" px-4 py-2 border-b" >
186+ {{ Number:: currency ($item -> budget , ' EUR' ) } } </td >
187+ </tr >
188+ @endforeach
189+ </tbody >
190+ </table >
191+ </div >
192+ </div >
193+ @endif
194+
195+
153196 </div >
154197 </div >
155198 </div >
0 commit comments