<?php

namespace App\Filament\Admin\Resources\OrderPackages\Schemas;

use Filament\Infolists\Components\IconEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class OrderPackageInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([

                Section::make('Payment Status')
                    ->schema([
                        Grid::make(2)
                            ->schema([
                                IconEntry::make('is_paid')
                                    ->boolean(),

                                TextEntry::make('status')
                                    ->placeholder('-'),
                            ]),
                    ]),

                Section::make('Payment Details')
                    ->schema([
                        Grid::make(2)
                            ->schema([
                                TextEntry::make('pm_type')
                                    ->label('Payment Method')
                                    ->placeholder('-'),

                                TextEntry::make('coupon.id')
                                    ->label('Coupon')
                                    ->placeholder('-'),
                            ]),
                    ]),

                Section::make('Relations')
                    ->schema([
                        Grid::make(2)
                            ->schema([
                                TextEntry::make('package.id')
                                    ->label('Package')
                                    ->placeholder('-'),

                                TextEntry::make('user.name')
                                    ->label('User')
                                    ->placeholder('-'),
                            ]),
                    ]),

                Section::make('Meta Information')
                    ->schema([
                        Grid::make(2)
                            ->schema([
                                TextEntry::make('created_at')
                                    ->dateTime()
                                    ->placeholder('-'),

                                TextEntry::make('updated_at')
                                    ->dateTime()
                                    ->placeholder('-'),
                            ]),
                    ]),
            ]);
    }
}
