|
8 | 8 | <div class="relative flex flex-col gap-5" x-data="{ forDate: new Date(@js($date)) }">
|
9 | 9 | <h3 class="text-xl font-semibold"><time datetime="{{ $date }}" x-text="forDate.toLocaleDateString()"></time></h3>
|
10 | 10 | @forelse($incidents as $incident)
|
11 |
| - <div x-data="{ timestamp: new Date(@js($incident->timestamp)) }" class="bg-white border divide-y rounded-lg ml-9 dark:divide-zinc-700 dark:border-zinc-700 dark:bg-white/5"> |
12 |
| - <div @class([ |
13 |
| - 'flex flex-col bg-zinc-50 p-4 dark:bg-accent-background gap-2', |
14 |
| - 'rounded-t-lg' => $incident->updates->isNotEmpty(), |
15 |
| - 'rounded-lg' => $incident->updates->isEmpty(), |
16 |
| - ])> |
17 |
| - @if ($incident->components()->exists()) |
18 |
| - <div class="text-xs font-medium"> |
19 |
| - {{ $incident->components->pluck('name')->join(', ', ' and ') }} |
20 |
| - </div> |
21 |
| - @endif |
22 |
| - <div class="flex flex-col sm:flex-row justify-between gap-2 flex-col-reverse items-start sm:items-center"> |
23 |
| - <div class="flex flex-col flex-1"> |
24 |
| - <div class="flex gap-2 items-center"> |
25 |
| - <h3 class="max-w-full text-base font-semibold break-words sm:text-xl"> |
26 |
| - <a href="{{ route('cachet.status-page.incident', $incident) }}">{{ $incident->name}}</a> |
27 |
| - </h3> |
28 |
| - @auth |
29 |
| - <a href="{{ $incident->filamentDashboardEditUrl() }}" class="underline text-right text-sm text-zinc-500 hover:text-zinc-400 dark:text-zinc-400 dark:hover:text-zinc-300" title="{{ __('cachet::incident.edit_button_title') }}"> |
30 |
| - <x-heroicon-m-pencil-square class="size-4" /> |
31 |
| - </a> |
32 |
| - @endauth |
33 |
| - </div> |
34 |
| - <span class="text-xs text-zinc-500 dark:text-zinc-400"> |
35 |
| - {{ $incident->timestamp->diffForHumans() }} — <time datetime="{{ $incident->timestamp->toW3cString() }}" x-text="timestamp.toLocaleString()"></time> |
36 |
| - </span> |
37 |
| - </div> |
38 |
| - <div class="flex justify-start sm:justify-end"> |
39 |
| - <x-cachet::badge :status="$incident->latestStatus" /> |
40 |
| - </div> |
41 |
| - </div> |
42 |
| - </div> |
43 |
| - |
44 |
| - <div class="relative"> |
45 |
| - <div class="absolute inset-y-0 -left-9"> |
46 |
| - <div class="ml-3.5 h-full border-l-2 border-dashed dark:border-zinc-700"></div> |
47 |
| - <div class="absolute inset-x-0 top-0 w-full h-24 bg-gradient-to-t from-transparent to-[rgb(var(--accent-background))]"></div> |
48 |
| - <div class="absolute inset-x-0 bottom-0 w-full h-24 bg-gradient-to-b from-transparent to-[rgb(var(--accent-background))]"></div> |
49 |
| - </div> |
50 |
| - <div class="flex flex-col px-4 divide-y dark:divide-zinc-700"> |
51 |
| - @foreach ($incident->updates as $update) |
52 |
| - <div class="relative py-4" x-data="{ timestamp: new Date(@js($update->created_at)) }"> |
53 |
| - <x-cachet::incident-update-status :status="$update->status" /> |
54 |
| - <h3 class="text-lg font-semibold">{{ $update->status->getLabel() }}</h3> |
55 |
| - <span class="text-xs text-zinc-500 dark:text-zinc-400"> |
56 |
| - {{ $update->created_at->diffForHumans() }} — <time datetime="{{ $update->created_at->toW3cString() }}" x-text="timestamp.toLocaleString()"></time> |
57 |
| - </span> |
58 |
| - <div class="prose-sm md:prose prose-zinc dark:prose-invert prose-a:text-accent-content prose-a:underline prose-p:leading-normal">{!! $update->formattedMessage() !!}</div> |
59 |
| - </div> |
60 |
| - @endforeach |
61 |
| - <div class="relative py-4" x-data="{ timestamp: new Date(@js($incident->timestamp)) }"> |
62 |
| - <x-cachet::incident-update-status :status="IncidentStatusEnum::unknown" /> |
63 |
| - |
64 |
| - <span class="text-xs text-zinc-500 dark:text-zinc-400"> |
65 |
| - {{ $incident->timestamp->diffForHumans() }} — <time datetime="{{ $incident->timestamp->toW3cString() }}" x-text="timestamp.toLocaleString()"></time> |
66 |
| - </span> |
67 |
| - <div class="prose-sm md:prose prose-zinc dark:prose-invert prose-a:text-accent-content prose-a:underline prose-p:leading-normal">{!! $incident->formattedMessage() !!}</div> |
68 |
| - </div> |
69 |
| - </div> |
70 |
| - </div> |
71 |
| - </div> |
| 11 | + @if($incident instanceof \Cachet\Models\Incident) |
| 12 | + <x-cachet::incident-item :incident="$incident" /> |
| 13 | + @elseif($incident instanceof \Cachet\Models\Schedule) |
| 14 | + <x-cachet::schedule-item :schedule="$incident" /> |
| 15 | + @endif |
72 | 16 | @empty
|
73 | 17 | <div class="bg-white border divide-y rounded-lg dark:divide-zinc-700 dark:border-zinc-700 dark:bg-white/5">
|
74 | 18 | <div class="flex flex-col p-4 divide-y dark:divide-zinc-700">
|
|
0 commit comments