<?php

declare(strict_types=1);

namespace App\Filament\Resources\Plugins\Schemas;

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

class PluginForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->label(__('admin.fields.name'))
                    ->required(),
                TextInput::make('version')
                    ->label(__('admin.fields.version'))
                    ->required()
                    ->default('1.0.0'),
                Toggle::make('enabled')
                    ->label(__('admin.fields.enabled'))
                    ->required(),
                TextInput::make('path')
                    ->label(__('admin.fields.path'))
                    ->required(),
                Textarea::make('config')
                    ->label(__('admin.fields.config'))
                    ->columnSpanFull(),
            ]);
    }
}
