<?php

declare(strict_types=1);

namespace App\Filament\Resources\Faqs\Schemas;

use App\Models\Faq;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class FaqForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            Section::make('سوال متداول')
                ->schema([
                    \App\Filament\Components\Form\ModelTypeSelect::create()->required()->columnSpan(6),
                    TextInput::make('model_id')->label('شناسه مدل')->required()->maxLength(26)->columnSpan(6),
                    \App\Filament\Components\Form\OrderTextInput::create()->columnSpan(4),
                    Select::make('status')
                        ->label('وضعیت')
                        ->options([
                            Faq::STATUS_PENDING => 'در انتظار',
                            Faq::STATUS_APPROVED => 'تایید',
                            Faq::STATUS_REJECTED => 'رد',
                        ])
                        ->default(Faq::STATUS_PENDING)
                        ->columnSpan(4),
                    \App\Filament\Components\Form\QuestionTextarea::create()->required()->columnSpan(12),
                    \App\Filament\Components\Form\ResponseTextarea::create()->columnSpan(12),
                    \App\Filament\Components\Form\CreatedBySelect::create()->required(),
                    \App\Filament\Components\Form\UpdatedBySelect::create(),
                ])
                ->columns(12)
                ->columnSpan(12),
        ])
            ->columns(12);
    }
}
