<?php

namespace App\Filament\Resources\ReviewResource\Pages;

use App\Filament\Resources\PackageResource;
use App\Filament\Resources\ReviewResource;
use App\Filament\Resources\ServiceResource;
use Filament\Infolists;
use Filament\Resources\Pages\ViewRecord;

class ViewReview extends ViewRecord
{
    protected static string $resource = ReviewResource::class;

    public function getInfolist(string $name): Infolists\Infolist
    {
        return Infolists\Infolist::make()
            ->schema([
                Infolists\Components\Section::make(__('Review Details'))
                    ->schema([
                        // Infolists\Components\TextEntry::make('id')
                        // ->label(__('ID')),
                        //             Infolists\Components\TextEntry::make('rating')
                        //                 ->label(__('Rating')),
                        //             Infolists\Components\TextEntry::make('comment')
                        //                 ->label(__('Comment')),
                        //             Infolists\Components\TextEntry::make('created_at')
                        //                 ->label(__('Created At'))
                        //                 ->dateTime(),
                        //             Infolists\Components\Actions\Action::make('view_product')
                        //                 ->label(__('View Product'))
                        //                 ->url(fn($record) => $record->product->type == 'service' ? ServiceResource::getUrl('view', ['record' => $record->product_id]) : PackageResource::getUrl('view', ['record' => $record->product_id])),
                        //             Infolists\Components\Actions\Action::make('view_user')
                        //                 ->label(__('View User'))
                        //                 ->url(fn($record) => \App\Filament\Resources\UserResource::getUrl('view', ['record' => $record->user_id])),
                    ]),
            ]);
    }
}
