<?php

namespace App\Filament\Resources\CollateralAssets\Tables;

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 CollateralAssetsTable
{
    public static function configure(Table $table): Table
    {
        return $table
            ->columns([
                TextColumn::make('symbol')
                    ->searchable(),
                TextColumn::make('name')
                    ->searchable(),
                TextColumn::make('gecko_id')
                    ->searchable(),
                TextColumn::make('network')
                    ->searchable(),
                TextColumn::make('wallet_provider_name')
                    ->searchable(),
                TextColumn::make('collateral_deposit_address')
                    ->searchable(),
                TextColumn::make('earn_deposit_address')
                    ->searchable(),
                TextColumn::make('loan_ltv_ratio')
                    ->numeric()
                    ->sortable(),
                TextColumn::make('min_collateral_coin')
                    ->numeric()
                    ->sortable(),
                TextColumn::make('staking_apr')
                    ->numeric()
                    ->sortable(),
                IconColumn::make('is_active')
                    ->boolean(),
                TextColumn::make('created_at')
                    ->dateTime()
                    ->sortable()
                    ->toggleable(isToggledHiddenByDefault: true),
                TextColumn::make('updated_at')
                    ->dateTime()
                    ->sortable()
                    ->toggleable(isToggledHiddenByDefault: true),
            ])
            ->filters([
                //
            ])
            ->recordActions([
                EditAction::make(),
            ])
            ->toolbarActions([
                BulkActionGroup::make([
                    DeleteBulkAction::make(),
                ]),
            ]);
    }
}
