<?php

declare(strict_types=1);

namespace App\Filament\Resources\Categories\Schemas;

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(__('category.name'))
                    ->required(),
                TextInput::make('slug')
                    ->label(__('category.slug'))
                    ->helperText('留空自动生成'),
                TextInput::make('display_order')
                    ->label(__('category.display_order'))
                    ->required()
                    ->numeric()
                    ->default(0),
                TextInput::make('post_count')
                    ->label(__('category.post_count'))
                    ->required()
                    ->numeric()
                    ->default(0)
                    ->disabled(),
            ]);
    }
}
