<?php

namespace App\Filament\Resources\Cities\Schemas;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Hidden;
use Filament\Schemas\Schema;

class CityForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Select::make('province_id')
                    ->label('Provinsi Induk') 
                    ->relationship('province', 'name')
                       ->searchable()
                    ->required(),
                TextInput::make('region_code')
                    ->label('Kode Wilayah (Region Code)') 
                    ->required(),
                TextInput::make('name')
                    ->label('Nama Kota/Kabupaten') 
                    ->required(),
                Hidden::make('created_by')
                    ->default(fn () => auth()->id()),
                Hidden::make('updated_by')
                    ->default(fn () => auth()->id()),
            ]);
    }
}