<?php

declare(strict_types=1);

namespace App\Filament\Resources\Categories\Schemas;

use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class CategoryForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->label(__('admin.fields.name'))
                    ->required(),
                TextInput::make('description')
                    ->label(__('admin.fields.description'))
                    ->maxLength(255)
                    ->helperText(__('admin.helpers.category_description')),
                Textarea::make('intro')
                    ->label(__('admin.fields.intro'))
                    ->rows(5)
                    ->columnSpanFull()
                    ->helperText(__('admin.helpers.category_intro')),
                TextInput::make('keywords')
                    ->label(__('admin.fields.keywords')),
                TextInput::make('cover_path')
                    ->label(__('admin.fields.cover_path'))
                    ->helperText(__('admin.helpers.category_cover')),
                TextInput::make('display_order')
                    ->label(__('admin.fields.display_order'))
                    ->required()
                    ->numeric()
                    ->default(0),
            ]);
    }
}
