<?php

namespace Modules\Cms\Filament\Resources\CmsPages\Schemas;

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

class CmsPageForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('meta_tags')
                    ->maxLength(255),
                TextInput::make('meta_keywords')
                    ->maxLength(255),
                TextInput::make('page')
                    ->required()
                    ->unique(ignoreRecord: true)
                    ->maxLength(255)
                    ->helperText('Unique key used to look up this page, e.g. "miniapp_faq".'),
                TextInput::make('title')
                    ->required()
                    ->maxLength(255),
                TextInput::make('mm_title')
                    ->required()
                    ->maxLength(255),
                RichEditor::make('content')
                    ->columnSpanFull(),
                RichEditor::make('mm_content')
                    ->columnSpanFull(),
                Toggle::make('is_active')
                    ->required()
                    ->default(true),
            ]);
    }
}
