<?php

namespace App\Filament\Resources\DisciplinaryReports\Schemas;

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

class DisciplinaryReportForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                HrForm::employeeSelect(),
                DatePicker::make('report_date')
                    ->label(__('hr.fields.report_date'))
                    ->required()
                    ->native(false)
                    ->default(now()),

                TextInput::make('title')
                    ->label(__('hr.fields.title'))
                    ->required()
                    ->maxLength(255),
                Textarea::make('description')
                    ->label(__('hr.fields.description'))
                    ->required()
                    ->rows(4)
                    ->columnSpanFull(),
                Select::make('severity')
                    ->label(__('hr.fields.severity'))
                    ->options(DisciplinarySeverity::class)
                    ->required()
                    ->native(false),
                HrForm::fileUpload('attachment_path')
                    ->label(__('hr.fields.attachment'))
                    ->acceptedFileTypes(['application/pdf', 'image/*'])
                    ->maxSize(10240),
            ]);
    }
}
