Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa authored and github-actions[bot] committed Sep 6, 2024
1 parent 7db6c9d commit 9516dae
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/Resources/MailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ public static function infolist(Infolist $infolist): Infolist
->label(__('Subject')),
TextEntry::make('from')
->label(__('From'))
->formatStateUsing(fn($state) => self::formatEmailAddress($state)),
->formatStateUsing(fn ($state) => self::formatEmailAddress($state)),
TextEntry::make('to')
->label(__('Recipient'))
->formatStateUsing(fn($state) => self::formatEmailAddress($state)),
->formatStateUsing(fn ($state) => self::formatEmailAddress($state)),
TextEntry::make('cc')
->label(__('CC'))
->default('-')
->formatStateUsing(fn($state) => self::formatEmailAddress($state)),
->formatStateUsing(fn ($state) => self::formatEmailAddress($state)),
TextEntry::make('bcc')
->label(__('BCC'))
->default('-')
->formatStateUsing(fn($state) => self::formatEmailAddress($state)),
->formatStateUsing(fn ($state) => self::formatEmailAddress($state)),
TextEntry::make('reply_to')
->default('-')
->label(__('Reply To'))
->formatStateUsing(fn($state) => self::formatEmailAddress($state)),
->formatStateUsing(fn ($state) => self::formatEmailAddress($state)),
]),
]),
Tab::make(__('Statistics'))
Expand Down Expand Up @@ -149,8 +149,8 @@ public static function infolist(Infolist $infolist): Infolist
TextEntry::make('type')
->label(__('Type'))
->badge()
->url(fn(MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', $record))
->color(fn(WebhookEventType $state): string => match ($state) {
->url(fn (MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', $record))
->color(fn (WebhookEventType $state): string => match ($state) {
WebhookEventType::DELIVERY => 'success',
WebhookEventType::CLICK => 'clicked',
WebhookEventType::OPEN => 'success',
Expand All @@ -162,7 +162,7 @@ public static function infolist(Infolist $infolist): Infolist
return ucfirst($state->value);
}),
TextEntry::make('occurred_at')
->url(fn(MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', $record))
->url(fn (MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', $record))
->since()
->dateTimeTooltip('d-m-Y H:i')
->label(__('Occurred At')),
Expand All @@ -187,7 +187,7 @@ public static function infolist(Infolist $infolist): Infolist
TextEntry::make('html')
->hiddenLabel()
->label(__('HTML Content'))
->formatStateUsing(fn(string $state, Mail $record): View => view(
->formatStateUsing(fn (string $state, Mail $record): View => view(
'filament-mails::mails.preview',
['html' => $state, 'mail' => $record],
)),
Expand All @@ -196,7 +196,7 @@ public static function infolist(Infolist $infolist): Infolist
->schema([
TextEntry::make('html')
->hiddenLabel()
->formatStateUsing(fn(string $state, Mail $record): View => view(
->formatStateUsing(fn (string $state, Mail $record): View => view(
'filament-mails::mails.html',
['html' => $state, 'mail' => $record],
))
Expand Down Expand Up @@ -237,7 +237,7 @@ public static function infolist(Infolist $infolist): Infolist
->label(__('Mime Type')),
ViewEntry::make('uuid')
->label(__('Download'))
->getStateUsing(fn($record) => $record)
->getStateUsing(fn ($record) => $record)
->view('filament-mails::mails.download'),
]),
]),
Expand All @@ -256,7 +256,7 @@ public static function table(Table $table): Table
->label(__('Status'))
->sortable()
->badge()
->color(fn(string $state): string => match ($state) {
->color(fn (string $state): string => match ($state) {
'Hard Bounced' => 'danger',
'Soft Bounced' => 'warning',
'Complained' => 'danger',
Expand All @@ -275,26 +275,26 @@ public static function table(Table $table): Table
Tables\Columns\IconColumn::make('attachments')
->label('')
->alignLeft()
->getStateUsing(fn(Mail $record) => $record->attachments->count() > 0)
->icon(fn(string $state): string => $state ? 'heroicon-o-paper-clip' : ''),
->getStateUsing(fn (Mail $record) => $record->attachments->count() > 0)
->icon(fn (string $state): string => $state ? 'heroicon-o-paper-clip' : ''),
Tables\Columns\TextColumn::make('to')
->label(__('Recipient'))
->formatStateUsing(fn($state) => self::formatEmailAddressForTable($state))
->formatStateUsing(fn ($state) => self::formatEmailAddressForTable($state))
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('opens')
->label(__('Opens'))
->tooltip(fn(Mail $record) => __('Last opened at :date', ['date' => $record->last_opened_at?->format('d-m-Y H:i')]))
->tooltip(fn (Mail $record) => __('Last opened at :date', ['date' => $record->last_opened_at?->format('d-m-Y H:i')]))
->sortable(),
Tables\Columns\TextColumn::make('clicks')
->label(__('Clicks'))
->tooltip(fn(Mail $record) => __('Last clicked at :date', ['date' => $record->last_clicked_at?->format('d-m-Y H:i')]))
->tooltip(fn (Mail $record) => __('Last clicked at :date', ['date' => $record->last_clicked_at?->format('d-m-Y H:i')]))
->sortable(),
Tables\Columns\TextColumn::make('sent_at')
->label(__('Sent At'))
->dateTime('d-m-Y H:i')
->since()
->tooltip(fn(Mail $record) => $record->sent_at?->format('d-m-Y H:i'))
->tooltip(fn (Mail $record) => $record->sent_at?->format('d-m-Y H:i'))
->sortable()
->searchable(),
])
Expand Down Expand Up @@ -412,4 +412,4 @@ private static function formatEmailAddressForTable($state): string

return implode(', ', array_keys($data));
}
}
}

0 comments on commit 9516dae

Please sign in to comment.