<?php

namespace App\Filament\Resources\Armadas\Schemas;

use Filament\Infolists\Components\ImageEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Schema;

class ArmadaInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                // 1. Nama Armada
                TextEntry::make('name')
                    ->label('Nama Armada'),

                // 2. Foto Armada
                ImageEntry::make('image')
                    ->label('Foto Armada')
                    ->disk('public')
                    ->height(200), // Tinggi gambar disesuaikan agar rapi

                // 3. Info Detail (Kapasitas & Volume)
                TextEntry::make('capacity')
                    ->label('Kapasitas')
                    ->placeholder('-'), // Muncul "-" jika data kosong

                TextEntry::make('volume')
                    ->label('Volume / Dimensi')
                    ->placeholder('-'),

                // 4. Urutan
                TextEntry::make('sort')
                    ->label('Urutan Tampil'),

                // 5. Timestamp
                TextEntry::make('created_at')
                    ->dateTime()
                    ->label('Dibuat Pada'),

                TextEntry::make('updated_at')
                    ->dateTime()
                    ->label('Terakhir Update'),
            ]);
    }
}