<?php

namespace App\Filament\Resources\ClientUploads\Schemas;

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

class ClientUploadForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->label('Nama Mitra/Klien') 
                    ->required()
                    ->maxLength(255),

                FileUpload::make('image')
                    ->label('Logo / Gambar') 
                    ->image()
                    ->directory('client-images') 
                    ->disk('public') 
                    ->maxSize(2048) 
                        ->required()
                        ->columnSpanFull()
                        ->helperText('Rekomendasi: Format JPG/PNG, Max 2MB.'),


                // BAGIAN AUDIT OTOMATIS
                Hidden::make('created_by')
                    ->default(fn () => auth()->id()),

                Hidden::make('updated_by')
                    ->default(fn () => auth()->id()),
            ]);
    }
}