<?php

namespace Modules\Routing\Filament\Resources\PopularRoutes;

use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Modules\Routing\Filament\Resources\PopularRoutes\Pages\CreatePopularRoute;
use Modules\Routing\Filament\Resources\PopularRoutes\Pages\EditPopularRoute;
use Modules\Routing\Filament\Resources\PopularRoutes\Pages\ListPopularRoutes;
use Modules\Routing\Filament\Resources\PopularRoutes\Schemas\PopularRouteForm;
use Modules\Routing\Filament\Resources\PopularRoutes\Tables\PopularRoutesTable;
use Modules\Routing\Models\PopularRoute;
use UnitEnum;

class PopularRouteResource extends Resource
{
    protected static ?string $model = PopularRoute::class;

    protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedFire;

    protected static string|UnitEnum|null $navigationGroup = 'Routing';

    public static function form(Schema $schema): Schema
    {
        return PopularRouteForm::configure($schema);
    }

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

    public static function getPages(): array
    {
        return [
            'index' => ListPopularRoutes::route('/'),
            'create' => CreatePopularRoute::route('/create'),
            'edit' => EditPopularRoute::route('/{record}/edit'),
        ];
    }
}
