<?php

namespace App\Filament\Resources\ResellerCommunityGroups\Schemas;

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

class ResellerCommunityGroupForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->label('Group Name')
                    ->placeholder('e.g. Reseller Updates Group')
                    ->required(),
                Select::make('type')
                    ->label('Platform Type')
                    ->options([
                        'whatsapp' => 'WhatsApp Group',
                        'telegram' => 'Telegram Channel / Group',
                    ])
                    ->required()
                    ->native(false),
                TextInput::make('url')
                    ->label('Join URL')
                    ->placeholder('e.g. https://chat.whatsapp.com/...')
                    ->url()
                    ->required()
                    ->columnSpanFull(),
                Textarea::make('description')
                    ->label('Description')
                    ->placeholder('What is this group used for? e.g. Daily stock alerts')
                    ->rows(3)
                    ->columnSpanFull(),
                Toggle::make('is_active')
                    ->label('Is Active')
                    ->default(true),
                TextInput::make('sort_order')
                    ->label('Sort Order')
                    ->numeric()
                    ->default(0),
            ]);
    }
}
