<?php

namespace App\Filament\Resources\Plans\Tables;

use Filament\Actions\EditAction;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class PlansTable
{
    public static function configure(Table $table): Table
    {
        return $table
            ->columns([
                TextColumn::make('name')
                    ->label('Tier')
                    ->badge()
                    ->sortable(),
                TextColumn::make('email_frequency')
                    ->label('Email')
                    ->placeholder('—'),
                TextColumn::make('sms_daily_limit')
                    ->label('SMS/day')
                    ->placeholder('—'),
                TextColumn::make('whatsapp_daily_limit')
                    ->label('WhatsApp/day')
                    ->placeholder('—'),
                TextColumn::make('max_fuel_types')
                    ->label('Fuel types')
                    ->placeholder('Unlimited'),
                IconColumn::make('active')
                    ->boolean(),
            ])
            ->defaultSort('id', 'asc')
            ->recordActions([
                EditAction::make(),
            ]);
    }
}
