view publishable/resources/views/components/preview-list-card.blade.php @ 2:b44434aaa767

Moving around the components. Made a big step in the right direction with the Builder and named joins being accessible.
author luka
date Wed, 18 Jun 2025 22:28:47 -0400
parents resources/views/components/preview-list-card.blade.php@56d9c64d64aa
children 84c75d9d90be
line wrap: on
line source

@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>