<?php

namespace App\Filament\Resources\Courses\Schemas;

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

class CourseForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('slug')
                    ->required(),
                TextInput::make('title')
                    ->required(),
                TextInput::make('subtitle')
                    ->default(null),
                Textarea::make('description')
                    ->default(null)
                    ->columnSpanFull(),
                TextInput::make('emoji')
                    ->default(null),
                TextInput::make('cover_path')
                    ->default(null),
                TextInput::make('level')
                    ->default(null),
                TextInput::make('topic')
                    ->helperText('Used for the course catalogue topic filter.')
                    ->default(null),
                TextInput::make('price_kes')
                    ->required()
                    ->numeric()
                    ->default(0),
                TextInput::make('price_usd')
                    ->required()
                    ->numeric()
                    ->default(0),
                Toggle::make('is_published')
                    ->required(),
                Textarea::make('outcomes')
                    ->default(null)
                    ->columnSpanFull(),
                TextInput::make('sort')
                    ->required()
                    ->numeric()
                    ->default(0),
            ]);
    }
}
