This commit is contained in:
salam committed 2026-03-11 12:33:41 +01:00
1 parent 7dea3ce335
commit 3d4bd5c7f3
1 file changed
+13 -10
+13 -10
View File
@@ -37,9 +37,10 @@ class EncounterHistory extends Component implements HasSchemas
Tabs::make('Tabs') Tabs::make('Tabs')
->tabs([ ->tabs([
Tab::make($this->home.' vs '.$this->away) Tab::make($this->home.' vs '.$this->away)
->badge(fn ($record) => count($record['results']['h2h']))
->schema([ ->schema([
RepeatableEntry::make('results.h2h') RepeatableEntry::make('results.h2h')
->label('Direct encounters') ->hiddenLabel()
->table([ ->table([
TableColumn::make('League'), TableColumn::make('League'),
TableColumn::make('Date'), TableColumn::make('Date'),
@@ -54,21 +55,22 @@ class EncounterHistory extends Component implements HasSchemas
}), }),
TextEntry::make('home.name')->color(fn (string $state): string => match ($state) { TextEntry::make('home.name')->color(fn (string $state): string => match ($state) {
$this->home => 'primary', $this->home => 'primary',
$this->away => 'success', $this->away => 'warning',
default => 'gray', default => 'gray',
}), }),
TextEntry::make('away.name')->color(fn (string $state): string => match ($state) { TextEntry::make('away.name')->color(fn (string $state): string => match ($state) {
$this->home => 'primary', $this->home => 'primary',
$this->away => 'success', $this->away => 'warning',
default => 'gray', default => 'gray',
}), }),
TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold), TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold),
]), ]),
]), ]),
Tab::make($this->home) Tab::make($this->home)
->badge(fn ($record) => count($record['results']['home']))
->schema([ ->schema([
RepeatableEntry::make('results.home') RepeatableEntry::make('results.home')
->label('The last games of '.$this->home) ->hiddenLabel()
->table([ ->table([
TableColumn::make('League'), TableColumn::make('League'),
TableColumn::make('Date'), TableColumn::make('Date'),
@@ -83,21 +85,22 @@ class EncounterHistory extends Component implements HasSchemas
}), }),
TextEntry::make('home.name')->color(fn (string $state): string => match ($state) { TextEntry::make('home.name')->color(fn (string $state): string => match ($state) {
$this->home => 'primary', $this->home => 'primary',
$this->away => 'success', $this->away => 'warning',
default => 'gray', default => 'gray',
}), }),
TextEntry::make('away.name')->color(fn (string $state): string => match ($state) { TextEntry::make('away.name')->color(fn (string $state): string => match ($state) {
$this->home => 'primary', $this->home => 'primary',
$this->away => 'success', $this->away => 'warning',
default => 'gray', default => 'gray',
}), }),
TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold), TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold),
]), ]),
]), ]),
Tab::make($this->away) Tab::make($this->away)
->badge(fn ($record) => count($record['results']['away']))
->schema([ ->schema([
RepeatableEntry::make('results.away') RepeatableEntry::make('results.away')
->label('The last games of '.$this->away) ->hiddenLabel()
->table([ ->table([
TableColumn::make('League'), TableColumn::make('League'),
TableColumn::make('Date'), TableColumn::make('Date'),
@@ -112,18 +115,18 @@ class EncounterHistory extends Component implements HasSchemas
}), }),
TextEntry::make('home.name')->color(fn (string $state): string => match ($state) { TextEntry::make('home.name')->color(fn (string $state): string => match ($state) {
$this->home => 'primary', $this->home => 'primary',
$this->away => 'success', $this->away => 'warning',
default => 'gray', default => 'gray',
}), }),
TextEntry::make('away.name')->color(fn (string $state): string => match ($state) { TextEntry::make('away.name')->color(fn (string $state): string => match ($state) {
$this->home => 'primary', $this->home => 'primary',
$this->away => 'success', $this->away => 'warning',
default => 'gray', default => 'gray',
}), }),
TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold), TextEntry::make('ss')->alignCenter()->weight(FontWeight::Bold),
]), ]),
]), ]),
]), ])->contained(false),
]); ]);
} }