40 lines
2.6 KiB
PHP
40 lines
2.6 KiB
PHP
<x-analytics-layout :website="$website" title="Funnels">
|
|||
|
|
<x-slot name="headerActions">
|
||
|
|
<a href="{{ route('funnels.create', $website) }}" class="inline-flex items-center gap-2 px-4 py-2 bg-indigo-600 rounded-lg text-sm font-medium text-white hover:bg-indigo-500 transition">
|
||
|
|
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /></svg>
|
||
|
|
Create Funnel
|
||
|
|
</a>
|
||
|
|
</x-slot>
|
||
|
|
|
||
|
|
@if (session('success'))
|
||
|
|
<div class="mb-6 rounded-xl bg-emerald-50 border border-emerald-200 p-4">
|
||
|
|
<p class="text-sm font-medium text-emerald-800">{{ session('success') }}</p>
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
|
||
|
|
@if ($funnels->isEmpty())
|
||
|
|
<x-empty-state
|
||
|
|
icon='<svg class="w-10 h-10" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z" /></svg>'
|
||
|
|
title="No funnels yet"
|
||
|
|
message="Create a funnel to visualize how visitors progress through a sequence of pages or events."
|
||
|
|
/>
|
||
|
|
@else
|
||
|
|
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||
|
|
@foreach ($funnels as $funnel)
|
||
|
|
<a href="{{ route('funnels.show', [$website, $funnel]) }}" class="bg-white rounded-xl border border-gray-200 p-5 hover:border-indigo-300 hover:shadow-sm transition group">
|
||
|
|
<h3 class="text-sm font-semibold text-gray-900 group-hover:text-indigo-600 transition">{{ $funnel->name }}</h3>
|
||
|
|
<p class="mt-1 text-xs text-gray-500">{{ count($funnel->steps) }} steps</p>
|
||
|
|
<div class="mt-3 flex items-center gap-1">
|
||
|
|
@foreach ($funnel->steps as $i => $step)
|
||
|
|
<span class="text-xs text-gray-400 truncate max-w-[80px]">{{ $step['label'] }}</span>
|
||
|
|
@if (! $loop->last)
|
||
|
|
<svg class="w-3 h-3 text-gray-300 shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" /></svg>
|
||
|
|
@endif
|
||
|
|
@endforeach
|
||
|
|
</div>
|
||
|
|
</a>
|
||
|
|
@endforeach
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
</x-analytics-layout>
|