<?php

namespace App\Filament\Resources\Clients\Pages;

use Filament\Schemas\Schema;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\Grid;
use App\Filament\Resources\Clients\ClientResource;
use Filament\Infolists\Components\TextEntry;
use Filament\Resources\Pages\ViewRecord;

class ViewClient extends ViewRecord
{
    protected static string $resource = ClientResource::class;

    public function infolist(Schema $schema): Schema
    {
        return $schema
            ->schema([
                Section::make()->schema([
                    Grid::make()->schema([
                        TextEntry::make('firstname')->label('First Name'),
                        TextEntry::make('middlename')->label('Middle Name'),
                        TextEntry::make('lastname')->label('Last Name'),
                        TextEntry::make('company')->label('Company'),
                        TextEntry::make('type.type')->label('Type'),
                    ])->columns(3),
                ])->columnSpanFull(),

                //                Section::make('Branches')->schema([
                //                    RepeatableEntry::make('branches')
                //                        ->schema([
                //                            TextEntry::make('code')->label('Branch Code'),
                //                            TextEntry::make('current_series')->label('Branch Current Series'),
                //                        ])
                //                        ->hiddenLabel()
                //                        ->grid(2),
                //                ])->collapsible(),
            ]);
    }

    //    public function getRelationManagers(): array
    //    {
    //        return [
    //            AccountsRelationManager::class,
    //            TransmittalsRelationManager::class,
    //        ];
    //    }
}
