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([
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),
]);
}