<?php

namespace Modules\Catalog\Filament\Resources\Destinations;

use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Modules\Catalog\Filament\Resources\Destinations\Pages\CreateDestination;
use Modules\Catalog\Filament\Resources\Destinations\Pages\EditDestination;
use Modules\Catalog\Filament\Resources\Destinations\Pages\ListDestinations;
use Modules\Catalog\Filament\Resources\Destinations\Schemas\DestinationForm;
use Modules\Catalog\Filament\Resources\Destinations\Tables\DestinationsTable;
use Modules\Catalog\Models\Destination;
use UnitEnum;

class DestinationResource extends Resource
{
    protected static ?string $model = Destination::class;

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

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

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

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

    public static function getRelations(): array
    {
        return [
            //
        ];
    }

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