<?php

namespace App\Filament\Clusters\Settings\LoanTypes\Schemas;

use Filament\Infolists\Components\IconEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class LoanTypeInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Section::make(__('Loan Type Information'))
                    ->columns(2)
                    ->components([
                        TextEntry::make('name')
                            ->label(__('Name')),

                        TextEntry::make('tax')
                            ->label(__('Tax'))
                            ->suffix('%')
                            ->default('—'),

                        TextEntry::make('maturity')
                            ->label(__('Loan term'))
                            ->default('—'),

                        IconEntry::make('active')
                            ->label(__('Active'))
                            ->boolean(),

                        TextEntry::make('notes')
                            ->label(__('Notes'))
                            ->columnSpanFull()
                            ->default('—'),

                        TextEntry::make('created_at')
                            ->label(__('Created At'))
                            ->dateTime(),

                        TextEntry::make('updated_at')
                            ->label(__('Updated At'))
                            ->dateTime(),
                    ]),
            ]);
    }
}
