1+ @props ([' message' , ' type' => ' info' , ' size' => ' md' , ' icon' => null , ' assetReady' => false ] )
2+ @use (' SolutionForest\InspireCms\InspireCmsConfig' )
3+ @php
4+ if (($fiPanelId = filament ()-> getCurrentPanel ()?-> getId ()) && $fiPanelId === InspireCmsConfig:: getPanelId ()) {
5+ $assetReady = true ; // Already loaded in index.css
6+ }
7+ @endphp
18<div {{
29 $attributes -> class ([
3- ' alert-dialog' ,
10+ ' alert-dialog px-4 overflow-x-auto ' ,
411 " alert-dialog-{$size }" => in_array ($size , [' sm' , ' md' , ' lg' ]),
512 ])-> style (\Filament \Support \get_color_css_variables (
613 $color ,
714 shades : [50 , 200 , 400 , 700 , 900 ],
815 ))
916} }
10- x-data =" {}"
11- x-load-css =" [@js (\Filament \Support \Facades \FilamentAsset:: getStyleHref (' filament-alert' , package : ' solution-forest/inspirecms' ) )]"
17+ x-data =" { ready: @js ($assetReady ) }"
18+ x-load-css =" [
19+ @js (\Filament \Support \Facades \FilamentAsset:: getStyleHref (' filament-alert' , package : ' solution-forest/inspirecms' ) )
20+ ]"
21+ data-dispatch =" alert-loaded"
22+ x-on:alert-loaded-css.window =" ready = true"
1223>
1324 <div class =" alert-dialog-body" >
14- <div class =" alert-dialog-icon-ctn" >
15- <x-filament::icon :icon =" $icon" />
16- </div >
17- <div class =" alert-dialog-content" >
18- <p >{{ $message } } </p >
19- </div >
25+ @if ($assetReady === true )
26+ @if ($icon )
27+ <div class =" alert-dialog-icon-ctn" >
28+ <x-filament::icon :icon =" $icon" />
29+ </div >
30+ @endif
31+ <div class =" alert-dialog-content" >
32+ <p >{{ $message } } </p >
33+ </div >
34+ @else
35+ @if ($icon )
36+ <div class =" alert-dialog-icon-ctn" x-show =" ready" x-cloak >
37+ <x-filament::icon :icon =" $icon" />
38+ </div >
39+ @endif
40+ <div class =" alert-dialog-content" >
41+ <p x-show =" ready" x-cloak >{{ $message } } </p >
42+ <p x-show =" !ready" >...</p >
43+ </div >
44+ @endif
2045 </div >
2146</div >
0 commit comments