<?php

namespace App\Filament\Admin\Resources\PackageCategories;

use App\Filament\Admin\Resources\PackageCategories\Pages\CreatePackageCategory;
use App\Filament\Admin\Resources\PackageCategories\Pages\EditPackageCategory;
use App\Filament\Admin\Resources\PackageCategories\Pages\ListPackageCategories;
use App\Filament\Admin\Resources\PackageCategories\Pages\ViewPackageCategory;
use App\Filament\Admin\Resources\PackageCategories\RelationManagers\PackagesRelationManager;
use App\Filament\Admin\Resources\PackageCategories\Schemas\PackageCategoryForm;
use App\Filament\Admin\Resources\PackageCategories\Schemas\PackageCategoryInfolist;
use App\Filament\Admin\Resources\PackageCategories\Tables\PackageCategoriesTable;
use App\Models\PackageCategory;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class PackageCategoryResource extends Resource
{
    protected static ?string $model = PackageCategory::class;

    protected static string|BackedEnum|null $navigationIcon = Heroicon::CubeTransparent;
    protected static string|UnitEnum|null $navigationGroup = "Package & Package Category";

    protected static ?string $recordTitleAttribute = 'PackageCategory';

    protected static ?int $navigationSort = 1;

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

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

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

    public static function getRelations(): array
    {
        return [
            PackagesRelationManager::class,
        ];
    }

    public static function getPages(): array
    {
        return [
            'index' => ListPackageCategories::route('/'),
            'create' => CreatePackageCategory::route('/create'),
            'view' => ViewPackageCategory::route('/{record}'),
            'edit' => EditPackageCategory::route('/{record}/edit'),
        ];
    }
}
