<?php

namespace App\Filament\Resources\ProfitCenterSupplierSchedules\Tables;

use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\EditAction;
use Filament\Actions\ForceDeleteBulkAction;
use Filament\Actions\RestoreBulkAction;
use Filament\Tables\Filters\TrashedFilter;
use Filament\Tables\Table;

class ProfitCenterSupplierSchedulesTable
{
    public static function configure(Table $table): Table
    {
        return $table
            ->columns([
                \Filament\Tables\Columns\TextColumn::make('profitCenter.name')
                    ->label('Profit Center')
                    ->searchable()
                    ->sortable(),
                \Filament\Tables\Columns\TextColumn::make('supplier.name')
                    ->label('Beszállító')
                    ->searchable()
                    ->sortable(),
                \Filament\Tables\Columns\TextColumn::make('deliverySchedule.name')
                    ->label('Szállítási sablon')
                    ->searchable()
                    ->sortable(),
            ])
            ->filters([
                TrashedFilter::make(),
            ])
            ->recordActions([
                EditAction::make(),
            ])
            ->toolbarActions([
                BulkActionGroup::make([
                    DeleteBulkAction::make(),
                    ForceDeleteBulkAction::make(),
                    RestoreBulkAction::make(),
                ]),
            ]);
    }
}
