<?php

namespace App\Filament\Resources\ResellerPackages\Tables;

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

class ResellerPackagesTable
{
    public static function configure(Table $table): Table
    {
        return $table
            ->columns([
                TextColumn::make('name')
                    ->label('Name')
                    ->searchable()
                    ->sortable(),
                TextColumn::make('price')
                    ->label('Package Price')
                    ->money('BDT')
                    ->sortable(),
                TextColumn::make('validity_days')
                    ->label('Duration')
                    ->suffix(' Days')
                    ->sortable(),
                IconColumn::make('is_active')
                    ->label('Active')
                    ->boolean()
                    ->sortable(),
                TextColumn::make('created_at')
                    ->label('Created At')
                    ->dateTime('d/m/Y')
                    ->sortable(),
            ])
            ->filters([
                //
            ])
            ->actions([
                EditAction::make()
                    ->label('Edit')
                    ->button()
                    ->color('warning'),
                DeleteAction::make()
                    ->label('Delete')
                    ->button()
                    ->color('danger'),
            ]);
    }
}
