<?php

declare(strict_types=1);

namespace App\Filament\Resources\Newsletters\Pages;

use App\Filament\Resources\Newsletters\NewsletterResource;
use Filament\Infolists\Components\TextEntry;
use Filament\Resources\Pages\ViewRecord;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class ViewNewsletter extends ViewRecord
{
    protected static string $resource = NewsletterResource::class;

    public function infolist(Schema $schema): Schema
    {
        return $schema
            ->components([
                Section::make('اطلاعات عضویت')
                    ->schema([
                        TextEntry::make('email')->label('ایمیل')->placeholder('-'),
                        TextEntry::make('cellphone')->label('شماره همراه')->placeholder('-'),
                        TextEntry::make('created_at')
                            ->label('تاریخ ثبت')
                            ->jalaliDateTime('Y/m/d H:i'),
                    ])
                    ->columns(2),
            ]);
    }
}
