<?php

namespace App\Filament\Resources\SickLeaves\Schemas;

use App\Models\SickLeave;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Schema;

class SickLeaveInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextEntry::make('employee.id')
                    ->label(__('hr.fields.employee')),
                TextEntry::make('start_date')
                    ->label(__('hr.fields.start_date'))
                    ->date(),
                TextEntry::make('end_date')
                    ->label(__('hr.fields.end_date'))
                    ->date(),
                TextEntry::make('days')
                    ->label(__('hr.fields.days'))
                    ->numeric(),
                TextEntry::make('medical_institution')
                    ->label(__('hr.fields.institution'))
                    ->placeholder('-'),
                TextEntry::make('reason')
                    ->label(__('hr.fields.reason'))
                    ->placeholder('-')
                    ->columnSpanFull(),
                TextEntry::make('document_path')
                    ->label(__('hr.fields.medical_document'))
                    ->placeholder('-'),
                TextEntry::make('created_at')
                    ->label(__('hr.fields.created_at'))
                    ->dateTime()
                    ->placeholder('-'),
                TextEntry::make('updated_at')
                    ->label(__('hr.fields.updated_at'))
                    ->dateTime()
                    ->placeholder('-'),
                TextEntry::make('deleted_at')
                    ->label(__('hr.fields.deleted_at'))
                    ->dateTime()
                    ->visible(fn (SickLeave $record): bool => $record->trashed()),
            ]);
    }
}
