<?php

declare(strict_types=1);

namespace App\Filament\Resources\Stylevars\Tables;

use App\Filament\Support\AdminTable;
use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\EditAction;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class StylevarsTable
{
    public static function configure(Table $table): Table
    {
        return $table
            ->columns([
                AdminTable::stickyStart(
                    TextColumn::make('id')
                        ->label(__('admin.fields.id'))
                        ->sortable(),
                ),
                AdminTable::ellipsis(
                    TextColumn::make('title')
                        ->label(__('admin.fields.title'))
                        ->searchable()
                        ->sortable(),
                ),
                AdminTable::ellipsis(
                    TextColumn::make('value')
                        ->label(__('admin.fields.value')),
                ),
                IconColumn::make('visible')
                    ->label(__('admin.fields.visible'))
                    ->boolean(),
                TextColumn::make('updated_at')
                    ->label(__('admin.fields.updated_at'))
                    ->dateTime()
                    ->sortable(),
            ])
            ->recordActions([
                EditAction::make(),
            ])
            ->toolbarActions([
                BulkActionGroup::make([
                    DeleteBulkAction::make(),
                ]),
            ]);
    }
}
