<?php

namespace App\Filament\Admin\Resources\OrderPackages;

use App\Filament\Admin\Resources\OrderPackages\Pages\CreateOrderPackage;
use App\Filament\Admin\Resources\OrderPackages\Pages\EditOrderPackage;
use App\Filament\Admin\Resources\OrderPackages\Pages\ListOrderPackages;
use App\Filament\Admin\Resources\OrderPackages\Pages\ViewOrderPackage;
use App\Filament\Admin\Resources\OrderPackages\Schemas\OrderPackageForm;
use App\Filament\Admin\Resources\OrderPackages\Schemas\OrderPackageInfolist;
use App\Filament\Admin\Resources\OrderPackages\Tables\OrderPackagesTable;
use App\Models\OrderPackage;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class OrderPackageResource extends Resource
{
    protected static ?string $model = OrderPackage::class;

    protected static string|BackedEnum|null $navigationIcon = Heroicon::PencilSquare;
    protected static string|UnitEnum|null $navigationGroup = "Package & Package Category";
    protected static ?int $navigationSort = 3;
    protected static ?string $recordTitleAttribute = 'OrderPackage';

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

    public static function infolist(Schema $schema): Schema
    {
        return OrderPackageInfolist::configure($schema);
    }

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

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

    public static function getPages(): array
    {
        return [
            'index' => ListOrderPackages::route('/'),
            'create' => CreateOrderPackage::route('/create'),
            'view' => ViewOrderPackage::route('/{record}'),
            'edit' => EditOrderPackage::route('/{record}/edit'),
        ];
    }
}
