From 565442dea54907df9f9bc52a8967c4ae3780669c Mon Sep 17 00:00:00 2001 From: Baspa Date: Wed, 30 Jul 2025 10:05:44 +0200 Subject: [PATCH] wip --- src/Resources/MailResource.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Resources/MailResource.php b/src/Resources/MailResource.php index 9f83e34..0405407 100644 --- a/src/Resources/MailResource.php +++ b/src/Resources/MailResource.php @@ -83,6 +83,7 @@ public static function infolist(Schema $schema): Schema ->icon('heroicon-o-envelope') ->compact() ->collapsible() + ->columnSpanFull() ->schema([ Tabs::make('') ->schema([ @@ -95,22 +96,22 @@ public static function infolist(Schema $schema): Schema ->label(__('Subject')), TextEntry::make('from') ->label(__('From')) - ->getStateUsing(fn (Mail $record) => self::formatMailState($record->from)), + ->formatStateUsing(fn (Mail $record) => self::formatMailState($record->from)), TextEntry::make('to') ->label(__('Recipient(s)')) - ->getStateUsing(fn (Mail $record) => self::formatMailState($record->to)), + ->formatStateUsing(fn (Mail $record) => self::formatMailState($record->to)), TextEntry::make('cc') ->label(__('CC')) ->default('-') - ->getStateUsing(fn (Mail $record) => self::formatMailState($record->cc ?? [])), + ->formatStateUsing(fn (Mail $record) => self::formatMailState($record->cc ?? [])), TextEntry::make('bcc') ->label(__('BCC')) ->default('-') - ->getStateUsing(fn (Mail $record) => self::formatMailState($record->bcc ?? [])), + ->formatStateUsing(fn (Mail $record) => self::formatMailState($record->bcc ?? [])), TextEntry::make('reply_to') ->default('-') ->label(__('Reply To')) - ->getStateUsing(fn (Mail $record) => self::formatMailState($record->reply_to ?? [])), + ->formatStateUsing(fn (Mail $record) => self::formatMailState($record->reply_to ?? [])), ]), ]), Tab::make(__('Statistics')) @@ -239,10 +240,8 @@ public static function infolist(Schema $schema): Schema Tabs::make('Content') ->label(__('Content')) ->columnSpanFull() - ->extraAttributes(['class' => 'w-full max-w-full']) ->tabs([ Tab::make('Preview') - ->extraAttributes(['class' => 'w-full max-w-full']) ->schema([ TextEntry::make('html') ->hiddenLabel() @@ -286,6 +285,7 @@ public static function infolist(Schema $schema): Schema ->icon('heroicon-o-paper-clip') ->compact() ->collapsible() + ->columnSpanFull() ->schema([ TextEntry::make('attachments') ->hiddenLabel() @@ -307,7 +307,7 @@ public static function infolist(Schema $schema): Schema ->label(__('Mime Type')), ViewEntry::make('uuid') ->label(__('Download')) - ->getStateUsing(fn ($record) => $record) + ->formatStateUsing(fn ($record) => $record) ->view('filament-mails::mails.download'), ]), ]), @@ -345,16 +345,16 @@ public static function table(Table $table): Table ->limit(35) ->sortable() ->searchable(['subject', 'html', 'text']), - IconColumn::make('attachments') - ->label('') - ->alignLeft() - ->searchable(false) - ->getStateUsing(fn (Mail $record) => $record->attachments->count() > 0) - ->icon(fn (string $state): string => $state ? 'heroicon-o-paper-clip' : ''), + // IconColumn::make('attachments') + // ->label('') + // ->alignLeft() + // ->searchable(false) + // ->formatStateUsing(fn (Mail $record) => $record->attachments->count() > 0) + // ->getIcon(fn (string $state): string => $state ? 'heroicon-o-paper-clip' : ''), TextColumn::make('to') ->label(__('Recipient(s)')) ->limit(50) - ->getStateUsing(fn (Mail $record) => self::formatMailState(emails: $record->to, mailOnly: true)) + ->formatStateUsing(fn (Mail $record) => self::formatMailState(emails: $record->to, mailOnly: true)) ->sortable() ->searchable(), TextColumn::make('opens')