From 0941ca11639a848dd46dab0168b466fc6d63692d Mon Sep 17 00:00:00 2001 From: Alex Popa Date: Fri, 27 Dec 2024 17:46:16 +0200 Subject: [PATCH] helper text report page --- .../Organizations/Pages/ReportsPage.php | 47 +++++++++++++++---- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/app/Filament/Organizations/Pages/ReportsPage.php b/app/Filament/Organizations/Pages/ReportsPage.php index c4cd83c3..a1497c3c 100644 --- a/app/Filament/Organizations/Pages/ReportsPage.php +++ b/app/Filament/Organizations/Pages/ReportsPage.php @@ -21,7 +21,10 @@ use Filament\Pages\Page; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\View\View; +use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; +use function Filament\Support\get_color_css_variables; class ReportsPage extends Page implements Forms\Contracts\HasForms, HasInfolists { @@ -102,15 +105,41 @@ protected function getFormSchema(): array ->live(), Checkbox::make('add_cases_in_monitoring') - ->label( - new HtmlString( - \sprintf( - '%s', - __('report.helpers.add_cases_in_monitoring'), - __('report.labels.add_cases_in_monitoring'), - ) - ) - ) + ->label(function () { + $icon = 'heroicon-o-information-circle'; + + $iconClasses = Arr::toCssClasses([ + 'fi-in-text-item-icon h-5 w-5 shrink-0', + 'text-custom-500', + ]); + + $iconColor = 'grey'; + $iconStyles = Arr::toCssStyles([ + get_color_css_variables($iconColor, shades: [500]) => $iconColor !== 'gray', + ]); + + $label = Blade::render(' +
+
+ {{ $label }} +
+ + + +
', [ + 'helper' => __('report.helpers.add_cases_in_monitoring'), + 'label' => __('report.labels.add_cases_in_monitoring'), + 'icon' => $icon, + 'iconClasses' => $iconClasses, + 'iconStyles' => $iconStyles, + ]); + + return new HtmlString($label); + }) ->columnSpan(2), Checkbox::make('show_missing_values')