<?php

namespace App\Filament\Resources\Products;

use App\Filament\Resources\Products\Pages\CreateProductAttribute;
use App\Filament\Resources\Products\Pages\EditProductAttribute;
use App\Filament\Resources\Products\Pages\ListProductAttributes;
use App\Filament\Resources\Products\Schemas\ProductAttributeForm;
use App\Filament\Resources\Products\Tables\ProductAttributesTable;
use App\Models\ProductAttribute;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;

class ProductAttributeResource extends Resource
{
    protected static ?string $model = ProductAttribute::class;

    protected static ?string $slug = 'variant-names';

    protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-tag';

    protected static string|\UnitEnum|null $navigationGroup = 'Products';

    protected static ?int $navigationSort = 3;

    protected static ?string $recordTitleAttribute = 'name';

    protected static ?string $navigationLabel = 'Variant Names';

    protected static ?string $pluralLabel = 'Variant Names';

    protected static ?string $modelLabel = 'Variant Name';

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

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

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

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