<?php

namespace App\Filament\Resources\Explanations\Schemas;

use App\Filament\Support\HrForm;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Schemas\Schema;

class ExplanationForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                HrForm::employeeSelect(),
                DatePicker::make('explanation_date')
                    ->label(__('hr.fields.explanation_date'))
                    ->required()
                    ->default(now()),
                TextInput::make('reason')
                    ->label(__('hr.fields.reason'))
                    ->required()
                    ->maxLength(255),
                Textarea::make('description')
                    ->label(__('hr.fields.description'))
                    ->required()
                    ->rows(4)
                    ->columnSpanFull(),
                HrForm::fileUpload('attachment_path')
                    ->label(__('hr.fields.attachment'))
                    ->acceptedFileTypes(['application/pdf', 'image/*'])
                    ->maxSize(10240),
            ]);
    }
}
