<?php

namespace App\Filament\Resources\Divisions\Schemas;

use App\Models\User;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class DivisionForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            TextInput::make('name')->label('Nama')->required(),
            Textarea::make('description')->label('Deskripsi')->rows(3)->columnSpanFull(),
            Select::make('leader_id')->label('Penanggung Jawab')
                ->options(
                    User::role('pengurus')->where('status', 'aktif')->pluck('name', 'id')
                )
                ->searchable()
                ->nullable(),
        ]);
    }
}
