<?php

namespace App\Filament\Resources\Explanations\Schemas;

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

class ExplanationInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextEntry::make('employee.id')
                    ->label(__('hr.fields.employee')),
                TextEntry::make('explanation_date')
                    ->date(),
                TextEntry::make('reason'),
                TextEntry::make('description')
                    ->columnSpanFull(),
                TextEntry::make('attachment_path')
                    ->placeholder('-'),
                TextEntry::make('created_at')
                    ->dateTime()
                    ->placeholder('-'),
                TextEntry::make('updated_at')
                    ->dateTime()
                    ->placeholder('-'),
                TextEntry::make('deleted_at')
                    ->dateTime()
                    ->visible(fn (Explanation $record): bool => $record->trashed()),
            ]);
    }
}
