Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
arduinomaster22 authored and github-actions[bot] committed Jan 11, 2025
1 parent a633e27 commit 4f739e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/filament-mails.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
'resources' => [
'mail' => MailResource::class,
'event' => EventResource::class,
'suppressions' => SuppressionResource::class
'suppressions' => SuppressionResource::class,
],
];
10 changes: 5 additions & 5 deletions src/Resources/EventResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function infolist(Infolist $infolist): Infolist
TextEntry::make('type')
->label(__('Type'))
->badge()
->color(fn(EventType $state): string => match ($state) {
->color(fn (EventType $state): string => match ($state) {
EventType::DELIVERED => 'success',
EventType::CLICKED => 'clicked',
EventType::OPENED => 'info',
Expand Down Expand Up @@ -121,7 +121,7 @@ public static function infolist(Infolist $infolist): Infolist
->default(__('Unknown'))
->label(__('User Agent'))
->limit(50)
->tooltip(fn($state) => $state),
->tooltip(fn ($state) => $state),
]),
]),
Section::make(__('Location'))
Expand Down Expand Up @@ -150,7 +150,7 @@ public static function infolist(Infolist $infolist): Infolist
->default(__('Unknown'))
->label(__('Link'))
->limit(50)
->url(fn($state) => $state)
->url(fn ($state) => $state)
->openUrlInNewTab(),
TextEntry::make('tag')
->default(__('Unknown'))
Expand Down Expand Up @@ -199,7 +199,7 @@ public static function table(Table $table): Table
->label(__('Type'))
->sortable()
->badge()
->color(fn(EventType $state): string => match ($state) {
->color(fn (EventType $state): string => match ($state) {
EventType::DELIVERED => 'success',
EventType::CLICKED => 'clicked',
EventType::OPENED => 'info',
Expand All @@ -220,7 +220,7 @@ public static function table(Table $table): Table
->label(__('Occurred At'))
->dateTime('d-m-Y H:i')
->since()
->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->tooltip(fn (MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->sortable()
->searchable(),
])
Expand Down
10 changes: 4 additions & 6 deletions src/Resources/SuppressionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
use Filament\Infolists\Infolist;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\Action;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Artisan;
use Vormkracht10\FilamentMails\Resources\SuppressionResource\Pages\ListSuppressions;
use Vormkracht10\Mails\Enums\EventType;
use Vormkracht10\Mails\Models\MailEvent;
Expand Down Expand Up @@ -79,21 +77,21 @@ public static function table(Table $table): Table
->columns([
Tables\Columns\TextColumn::make('mail.to')
->label(__('Email address'))
->formatStateUsing(fn(MailEvent $record) => key($record->mail->to))
->formatStateUsing(fn (MailEvent $record) => key($record->mail->to))
->searchable(['to']),

Tables\Columns\TextColumn::make('occurred_at')
->badge()
->label(__('Suppressed At'))
->dateTime('d-m-Y H:i')
->since()
->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->tooltip(fn (MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->sortable()
->searchable(),
])
->actions([
Tables\Actions\Action::make('unsupress')
->action(fn(MailEvent $record) => $record->unSuppress()),
->action(fn (MailEvent $record) => $record->unSuppress()),

Tables\Actions\ViewAction::make()
->url(null)
Expand All @@ -102,7 +100,7 @@ public static function table(Table $table): Table
->label(__('View'))
->hiddenLabel()
->tooltip(__('View'))
->infolist(fn(Infolist $infolist) => EventResource::infolist($infolist)),
->infolist(fn (Infolist $infolist) => EventResource::infolist($infolist)),
]);
}

Expand Down

0 comments on commit 4f739e4

Please sign in to comment.