diff resources/views/components/preview-list-card.blade.php @ 1:56d9c64d64aa

Setting up the base, still have plenty of work to be done here.
author luka
date Mon, 09 Jun 2025 23:07:17 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resources/views/components/preview-list-card.blade.php	Mon Jun 09 23:07:17 2025 -0400
@@ -0,0 +1,22 @@
+@props([
+    'title', // e.g. 'Upcoming Milestones'
+    'icon', // SVG (pass as a Blade include or html)
+    'items', // Collection of items to show
+    'itemView', // Partial for rendering each item
+    'viewData' => [], // Additional data to pass to the partial
+    'empty' => 'Nothing to show.',
+    'footer' => null, // Optional (e.g. a "View All" link)
+    'headerButton' => null, // Optional (e.g. a "Add" link)
+])
+
+<x-card :icon="$icon" :title="$title" :headerButton="$headerButton" :footer="$footer">
+    @if ($items->count())
+        <ul class="divide-y divide-gray-100">
+            @foreach ($items as $item)
+                @include($itemView, array_merge(['item' => $item], $viewData ?? []))
+            @endforeach
+        </ul>
+    @else
+        <div class="text-gray-400 text-sm">{{ $empty }}</div>
+    @endif
+</x-card>