<?php

declare(strict_types=1);

namespace App\Filament\Resources\Logs\Schemas;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class LogForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            Section::make('جزئیات رویداد')
                ->schema([
                    TextInput::make('event')->label('رویداد')->required()->maxLength(255)->columnSpan(6),
                    \App\Filament\Components\Form\UserSelect::create()->columnSpan(6),
                    TextInput::make('ip')->label('آی‌پی')->maxLength(45)->columnSpan(4),
                    TextInput::make('location')->label('موقعیت')->maxLength(255)->columnSpan(4),
                    TextInput::make('priority')->label('اولویت')->numeric()->required()->columnSpan(4),
                    Toggle::make('is_viewed')->label('مشاهده شده')->columnSpan(4),
                    \App\Filament\Components\Form\CountTextInput::create()->required()->columnSpan(4),
                    \App\Filament\Components\Form\DescTextarea::create()->label('توضیحات')->columnSpan(12),
                    \App\Filament\Components\Form\CreatedBySelect::create()->required(),
                    \App\Filament\Components\Form\UpdatedBySelect::create(),
                ])
                ->columns(12)
                ->columnSpan(12),
        ])
            ->columns(12);
    }
}
