<?php

declare(strict_types=1);

namespace App\Filament\Resources\Breeds\Schemas;

use Filament\Schemas\Components\Group;
use Filament\Schemas\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class BreedForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            Group::make()
                ->schema([
                    Section::make('اطلاعات اصلی')
                        ->schema([
                            TextInput::make('name')
                                ->label('نام نژاد')
                                ->required()
                                ->maxLength(255)
                                ->columnSpan(6),
                            
                            TextInput::make('en_name')
                                ->label('نام انگلیسی')
                                ->maxLength(255)
                                ->columnSpan(6),
                            
                            \App\Filament\Components\Form\CategorySelect::create()
                                ->label('دسته'),
                            
                            \App\Filament\Components\Form\DescTextarea::create(),
                        ])
                        ->columns(12)
                        ->columnSpan(12),
                ])
                ->columns(12)
                ->columnSpan(8),
            
            Group::make()
                ->schema([
                    Section::make('وضعیت')
                        ->schema([
                            Select::make('status')
                                ->label('وضعیت')
                                ->options([
                                    'active' => 'فعال',
                                    'inactive' => 'غیرفعال',
                                ])
                                ->default('active')
                                ->columnSpan(12),
                        ])
                        ->columns(12)
                        ->columnSpan(12),
                    
                    Section::make('اطلاعات سیستم')
                        ->schema([
                            \App\Filament\Components\Form\CreatedBySelect::create()->required(),
                            \App\Filament\Components\Form\UpdatedBySelect::create(),
                        ])
                        ->columns(12)
                        ->columnSpan(12),
                ])
                ->columns(12)
                ->columnSpan(4),
        ])
        ->columns(12);
    }
}

