diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php
index d68afdfd..79c8a18f 100644
--- a/app/Filament/Pages/Statistic.php
+++ b/app/Filament/Pages/Statistic.php
@@ -129,7 +129,6 @@ class Statistic extends BaseDashboard
->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger')
->prefixIcon('phosphor-trophy-fill')
->hiddenLabel()
- // ->options(fn(Get $get) => SofaScoreTournament::with('sofascore_category')->where('sofa_score_category_id', $get('sofascore_category_id'))->pluck('name', 'tournament_id'))
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
->placeholder('League')
->afterStateUpdated(function (callable $set) {
@@ -244,12 +243,20 @@ class Statistic extends BaseDashboard
'snt' => 'Shots On Target',
'tsh' => 'Total Shots',
]),
+
+ /************************
+ * SMP
+ ************************/
Select::make('similar_past_matches')
->live()
->hiddenLabel()
- ->prefix('SPM')
+ ->suffixAction(Action::make('reset')
+ ->icon('phosphor-x-circle')
+ ->action(fn(callable $set) => $set('similar_past_matches', 'none'))
+ ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'info' : 'gray'))
->placeholder('Similar Past Matches')
->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('
± ' . $get('accuracy') . '
') : '')
+ ->prefix('SPM')
->prefixAction(
Action::make('iconInfo')
->icon('phosphor-question-fill')
@@ -359,7 +366,6 @@ class Statistic extends BaseDashboard
->multiple()
->placeholder('Current Season')
->prefixIconColor('success')
- // ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary')
->hidden(fn(Get $get) => $get('seasonmode') == 'halfyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill')
->options([
@@ -367,11 +373,8 @@ class Statistic extends BaseDashboard
'2025' => '2025',
'2024' => '2024',
])
- // ->options(function (Get $get) {
- // return LoadSeasons::load($get('seasonmode'));
- // })
- ->afterStateUpdated(function (callable $set) {
- // $set('ss_player_id', null);
+ ->afterStateUpdated(function (callable $set, Get $get) {
+ $set('ss_player_id', null);
}),
/************************
* SEASON halftime
@@ -383,7 +386,6 @@ class Statistic extends BaseDashboard
->multiple()
->placeholder('Current Season')
->prefixIconColor('success')
- // ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary')
->hidden(fn(Get $get) => $get('seasonmode') == 'fullyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill')
->options([
@@ -391,11 +393,8 @@ class Statistic extends BaseDashboard
'25/26' => '25/26',
'24/25' => '24/25',
])
- // ->options(function (Get $get) {
- // return LoadSeasons::load($get('seasonmode'));
- // })
->afterStateUpdated(function (callable $set) {
- // $set('ss_player_id', null);
+ $set('ss_player_id', null);
}),
/************************
* DATE PICKER