<?php

namespace App\Filament\Resources\UserResource\RelationManagers;

use Filament\Actions\BulkActionGroup;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class UsageLogsRelationManager extends RelationManager
{
    protected static string $relationship = 'usageLogs';

    protected static ?string $title = 'Email Usage Logs';

    public function table(Table $table): Table
    {
        return $table

            ->columns([
                TextColumn::make('ip_address')
                    ->label('IP Address')
                    ->sortable()
                    ->searchable(),
                TextColumn::make('emails_created_count')
                    ->label('Emails Created')
                    ->sortable(),
                TextColumn::make('emails_received_count')
                    ->label('Emails Received')
                    ->sortable(),
                TextColumn::make('updated_at')
                    ->label('Last Activity At')
                    ->dateTime()
                    ->sortable(),
            ])
            ->filters([
                //
            ])
            ->headerActions([
                // Tables\Actions\CreateAction::make(),
            ])
            ->recordActions([
                // Tables\Actions\EditAction::make(),
                // Tables\Actions\DeleteAction::make(),
            ])
            ->toolbarActions([
                BulkActionGroup::make([
                    // Tables\Actions\DeleteBulkAction::make(),
                ]),
            ]);
    }
}
