diff --git a/app/Livewire/EncounterHistory.php b/app/Livewire/EncounterHistory.php index ac00b0b2..ca09c53f 100644 --- a/app/Livewire/EncounterHistory.php +++ b/app/Livewire/EncounterHistory.php @@ -37,9 +37,10 @@ class EncounterHistory extends Component implements HasSchemas Tabs::make('Tabs') ->tabs([ Tab::make($this->home.' vs '.$this->away) + ->badge(fn ($record) => count($record['results']['h2h'])) ->schema([ RepeatableEntry::make('results.h2h') - ->label('Direct encounters') + ->hiddenLabel() ->table([ TableColumn::make('League'), TableColumn::make('Date'), @@ -54,21 +55,22 @@ class EncounterHistory extends Component implements HasSchemas }), TextEntry::make('home.name')->color(fn (string $state): string => match ($state) { $this->home => 'primary', - $this->away => 'success', + $this->away => 'warning', default => 'gray', }), TextEntry::make('away.name')->color(fn (string $state): string => match ($state) { $this->home => 'primary', - $this->away => 'success', + $this->away => 'warning', default => 'gray', }), TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold), ]), ]), Tab::make($this->home) + ->badge(fn ($record) => count($record['results']['home'])) ->schema([ RepeatableEntry::make('results.home') - ->label('The last games of '.$this->home) + ->hiddenLabel() ->table([ TableColumn::make('League'), TableColumn::make('Date'), @@ -83,21 +85,22 @@ class EncounterHistory extends Component implements HasSchemas }), TextEntry::make('home.name')->color(fn (string $state): string => match ($state) { $this->home => 'primary', - $this->away => 'success', + $this->away => 'warning', default => 'gray', }), TextEntry::make('away.name')->color(fn (string $state): string => match ($state) { $this->home => 'primary', - $this->away => 'success', + $this->away => 'warning', default => 'gray', }), TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold), ]), ]), Tab::make($this->away) + ->badge(fn ($record) => count($record['results']['away'])) ->schema([ RepeatableEntry::make('results.away') - ->label('The last games of '.$this->away) + ->hiddenLabel() ->table([ TableColumn::make('League'), TableColumn::make('Date'), @@ -112,18 +115,18 @@ class EncounterHistory extends Component implements HasSchemas }), TextEntry::make('home.name')->color(fn (string $state): string => match ($state) { $this->home => 'primary', - $this->away => 'success', + $this->away => 'warning', default => 'gray', }), TextEntry::make('away.name')->color(fn (string $state): string => match ($state) { $this->home => 'primary', - $this->away => 'success', + $this->away => 'warning', default => 'gray', }), TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold), ]), ]), - ]), + ])->contained(false), ]); }