<?php

declare(strict_types=1);

namespace App\Filament\Resources\Newsletters;

use App\Filament\Resources\Newsletters\Pages\ListNewsletters;
use App\Filament\Resources\Newsletters\Pages\ViewNewsletter;
use App\Filament\Resources\Newsletters\Tables\NewslettersTable;
use App\Models\Newsletter;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Tables\Table;
use UnitEnum;

class NewsletterResource extends Resource
{
    protected static ?string $model = Newsletter::class;

    protected static string|BackedEnum|null $navigationIcon = \Filament\Support\Icons\Heroicon::OutlinedEnvelope;

    protected static string|null|UnitEnum $navigationGroup = 'پشتیبانی';

    protected static ?string $navigationLabel = 'خبرنامه';

    protected static ?string $modelLabel = 'عضو خبرنامه';

    protected static ?string $pluralModelLabel = 'اعضای خبرنامه';

    public static function table(Table $table): Table
    {
        return NewslettersTable::configure($table);
    }

    public static function getPages(): array
    {
        return [
            'index' => ListNewsletters::route('/'),
            'view' => ViewNewsletter::route('/{record}'),
        ];
    }
}
