clear button similar_past_matches

This commit is contained in:
salam committed 2026-08-31 09:57:11 +02:00
1 parent bb4acc5e80
commit 48e7abbe2b
1 file changed
+12 -13
+12 -13
View File
@@ -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('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± ' . $get('accuracy') . '</div>') : '')
->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