<?php

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

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

use Filament\Schemas\Schema;

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

Section::make('Basic Information')
    ->schema([
        Grid::make(2)
            ->schema([
                TextEntry::make('en_name')
                    ->placeholder('-'),

                TextEntry::make('fa_name')
                    ->placeholder('-'),

                TextEntry::make('slug')
                    ->placeholder('-'),

                TextEntry::make('packageCategory.id')
                    ->label('Package Category')
                    ->placeholder('-'),
            ]),
    ]),

Section::make('Pricing')
    ->schema([
        Grid::make(2)
            ->schema([
                TextEntry::make('price')
                    ->money(),

                TextEntry::make('discount')
                    ->numeric(),
            ]),
    ]),

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

                IconEntry::make('is_featured')
                    ->boolean(),
            ]),
    ]),

Section::make('Thumbnail')
    ->schema([
        ImageEntry::make('thumbnail')
            ->label('Thumbnail')
            ->disk('public')
            ->placeholder('-'),
    ])
    ->columnSpanFull(),

Section::make('Descriptions')
    ->schema([
        Grid::make(1)
            ->schema([
                TextEntry::make('en_description')
                    ->placeholder('-')
                    ->html()
                    ->prose(),

                TextEntry::make('fa_description')
                    ->placeholder('-')
                    ->html()
                    ->prose(),
            ]),
    ])
    ->columnSpanFull(),

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

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

            ]);
    }
}
