<?php

namespace App\Filament\Resources\EmployeeDocuments\Schemas;

use App\Enums\DocumentType;
use App\Filament\Support\HrForm;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class EmployeeDocumentForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                HrForm::employeeSelect(),
                Select::make('document_type')
                    ->label(__('hr.fields.document_type'))
                    ->options(DocumentType::class)
                    ->required()
                    ->native(false),
                TextInput::make('title')
                    ->label(__('hr.fields.title'))
                    ->required()
                    ->maxLength(255),
                HrForm::fileUpload('file_path')
                    ->label(__('hr.fields.document'))
                    ->required()
                    ->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
                    ->maxSize(15360),
            ]);
    }
}
