<?php

declare(strict_types=1);

namespace App\Filament\Resources\Categories\Schemas;

use App\Models\Category;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class CategoryForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            Section::make('دسته‌بندی')
                ->schema([
                    \App\Filament\Components\Form\TitleTextInput::create()->required()->columnSpan(6),
                    \App\Filament\Components\Form\SlugTextInput::create()->required()->columnSpan(6),
                    \App\Filament\Components\Form\ModelTypeSelect::create()->required()->columnSpan(6),
                    \App\Filament\Components\Form\ParentSelect::create(Category::class)->columnSpan(6),
                    \App\Filament\Components\Form\RootSelect::create()->columnSpan(6),
                    \App\Filament\Components\Form\OrderTextInput::create()->required()->columnSpan(3),
                    \App\Filament\Components\Form\LevelTextInput::create()->columnSpan(3),
                    \App\Filament\Components\Form\PageTitleTextInput::create()->required()->columnSpan(6),
                    \App\Filament\Components\Form\UrlTextInput::create()->columnSpan(6),
                    \App\Filament\Components\Form\IconFileUpload::create()->columnSpan(12),
                    \App\Filament\Components\Form\DescTextarea::create()->columnSpan(12),
                ])
                ->columns(12)
                ->columnSpan(12),
            Section::make('سئو')
                ->schema([
                    \App\Filament\Components\Form\MetaTitleTextInput::create()->columnSpan(12),
                    \App\Filament\Components\Form\MetaDescTextarea::create()->columnSpan(12),
                    \App\Filament\Components\Form\MetaKeywordsTagsInput::create()->columnSpan(12),
                    \App\Filament\Components\Form\CreatedBySelect::create()->required(),
                    \App\Filament\Components\Form\UpdatedBySelect::create(),
                ])
                ->columns(12)
                ->columnSpan(12),
        ])
            ->columns(12);
    }
}
