<?php

namespace App\Filament\Resources\ClientResource\Pages;

use App\Filament\Resources\ClientResource;
use Filament\Infolists\Components\Grid;
use Filament\Infolists\Components\Section;
use Filament\Infolists\Components\TextEntry;
use Filament\Infolists\Infolist;
use Filament\Resources\Pages\ViewRecord;

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

    public function infolist(Infolist $infolist): Infolist
    {
        return $infolist
            ->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),
                ]),

                //                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,
    //        ];
    //    }
}
