<?php

namespace App\Filament\Clusters\Settings\Resources\CurrencyRates\Schemas;

use App\Modules\CurrencyRate\Models\CurrencyRate;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class CurrencyRateForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Select::make('currency_from')
                    ->label(__('Currency from'))
                    ->native(false)
                    ->searchable()
                    ->options(CurrencyRate::currencies())
                    ->rules('required')
                    ->belowLabel('1 möçberi'),

                Select::make('currency_to')
                    ->label(__('Currency to'))
                    ->native(false)
                    ->searchable()
                    ->options(CurrencyRate::currencies())
                    ->rules('required')
                    ->belowLabel('1 möçberi'),

                TextInput::make('value')
                    ->label(__('Currency value'))
                    ->required()
                    ->numeric()
                    ->belowLabel('Bitin däl sanlary "." bilen ýazmaly'),
            ]);
    }
}
