<?php

namespace App\Filament\Resources\Facilities\Schemas;

use Filament\Schemas\Schema;
use Filament\Schemas\Components\Section;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Select;
// Hapus baris use FileUpload jika ada

class FacilityForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Section::make('Detail Fasilitas')
                    ->schema([
                        TextInput::make('name')
                            ->required()
                            ->maxLength(255)
                            ->label('Nama Fasilitas (Misal: AC, Parkir Motor)'),

                        Select::make('category')
                            ->options([
                                'kamar' => 'Fasilitas Kamar (Hanya muncul di Form Kamar)',
                                'properti' => 'Fasilitas Properti (Hanya muncul di Form Kos/Kontrakan)',
                            ])
                            ->required()
                            ->default('properti')
                            ->label('Kategori Fasilitas'),

                        // Cari bagian ini dan ubah 'image' menjadi 'icon'
                        TextInput::make('icon') // <--- UBAH DI SINI
                            ->required()
                            ->maxLength(255)
                            ->label('Kode Icon (Misal: heroicon-o-wifi)')
                            ->columnSpanFull(),
                    ])->columns(2),
            ]);
    }
}
