<?php

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

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

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


                Section::make('Titles')
                    ->schema([
                        Grid::make(3)
                            ->schema([
                                TextEntry::make('en_title')
                                    ->placeholder('-'),

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

                                TextEntry::make('slug'),
                            ]),
                    ]),

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

                Section::make('Content')
                    ->schema([
                        TextEntry::make('en_content')
                            ->placeholder('-')
                            ->html()
                            ->columnSpanFull(),

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

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

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

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

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

            ]);
    }
}
