File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed
resources/views/components Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 5
5
shades : [200 , 900 ],
6
6
),
7
7
]),
8
- ]) } } >
8
+ ])-> merge ([ ' title ' => $title ]) } } >
9
9
<div class =" absolute -left-[calc(28px+10px+13px)] top-4 flex h-7 w-7 items-center justify-center rounded-full bg-custom-200 dark:text-zinc-900" >
10
- @svg ($icon , ' h-5 w-5' )
10
+ @if ($icon )
11
+ @svg ($icon , ' size-5' )
12
+ @else
13
+ <x-heroicon-m-flag class =" size-4" />
14
+ @endif
11
15
</div >
12
16
</div >
Original file line number Diff line number Diff line change 56
56
<div class =" prose-sm md:prose prose-zinc dark:prose-invert prose-a:text-primary-500 prose-a:underline prose-p:leading-normal" >{!! $update -> formattedMessage () ! !} </div >
57
57
</div >
58
58
@endforeach
59
- <div class =" relative py-4" x-data =" { timestamp: new Date(@js ($incident -> created_at )) }" >
60
- <x-cachet::incident-update-status :status = " $incident->status " />
59
+ <div class =" relative py-4" x-data =" { timestamp: new Date(@js ($incident -> created_at )) }" >
60
+ <x-cachet::incident-update-status />
61
61
62
- <span class =" text-xs text-zinc-500 dark:text-zinc-400" >
63
- {{ $incident -> created_at -> diffForHumans () } } — <time datetime =" {{ $incident -> created_at -> toW3cString () } }" x-text =" timestamp.toLocaleString()" ></time >
64
- </span >
65
- <div class =" prose-sm md:prose prose-zinc dark:prose-invert prose-a:text-primary-500 prose-a:underline prose-p:leading-normal" >{!! $incident -> formattedMessage () ! !} </div >
66
- </div >
62
+ <span class =" text-xs text-zinc-500 dark:text-zinc-400" >
63
+ {{ $incident -> created_at -> diffForHumans () } } — <time datetime =" {{ $incident -> created_at -> toW3cString () } }" x-text =" timestamp.toLocaleString()" ></time >
64
+ </span >
65
+ <div class =" prose-sm md:prose prose-zinc dark:prose-invert prose-a:text-primary-500 prose-a:underline prose-p:leading-normal" >{!! $incident -> formattedMessage () ! !} </div >
66
+ </div >
67
67
</div >
68
68
</div >
69
69
</div >
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public function getLabel(): string
39
39
self ::identified => __ ('Identified ' ),
40
40
self ::watching => __ ('Watching ' ),
41
41
self ::fixed => __ ('Fixed ' ),
42
+ default => __ ('Reported ' ),
42
43
};
43
44
}
44
45
@@ -56,9 +57,9 @@ public function getColor(): string|array|null
56
57
{
57
58
return match ($ this ) {
58
59
self ::investigating => 'warning ' ,
59
- self ::identified => 'gray ' ,
60
60
self ::watching => 'info ' ,
61
61
self ::fixed => 'success ' ,
62
+ default => 'gray ' ,
62
63
};
63
64
}
64
65
}
Original file line number Diff line number Diff line change 3
3
namespace Cachet \View \Components ;
4
4
5
5
use Cachet \Enums \IncidentStatusEnum ;
6
- use Cachet \Models \IncidentUpdate ;
7
6
use Closure ;
8
7
use Illuminate \Contracts \View \View ;
9
8
use Illuminate \View \Component ;
@@ -13,7 +12,7 @@ class IncidentUpdateStatus extends Component
13
12
/**
14
13
* Create a new component instance.
15
14
*/
16
- public function __construct (public IncidentStatusEnum $ status )
15
+ public function __construct (public readonly ? IncidentStatusEnum $ status = null )
17
16
{
18
17
//
19
18
}
@@ -24,8 +23,9 @@ public function __construct(public IncidentStatusEnum $status)
24
23
public function render (): View |Closure |string
25
24
{
26
25
return view ('cachet::components.incident-update-status ' , [
27
- 'color ' => $ this ->status ->getColor (),
28
- 'icon ' => $ this ->status ->getIcon (),
26
+ 'title ' => $ this ->status ?->getLabel(),
27
+ 'color ' => $ this ->status ?->getColor() ?? 'gray ' ,
28
+ 'icon ' => $ this ->status ?->getIcon(),
29
29
]);
30
30
}
31
31
}
You can’t perform that action at this time.
0 commit comments