<?php

declare(strict_types=1);

namespace App\Filament\Resources\MarketPrices;

use App\Filament\Resources\MarketPrices\Pages\CreateMarketPrice;
use App\Filament\Resources\MarketPrices\Pages\EditMarketPrice;
use App\Filament\Resources\MarketPrices\Pages\ListMarketPrices;
use App\Filament\Resources\MarketPrices\Schemas\MarketPriceForm;
use App\Filament\Resources\MarketPrices\Tables\MarketPricesTable;
use App\Models\MarketPrice;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
use UnitEnum;

class MarketPriceResource extends Resource
{
    protected static ?string $model = MarketPrice::class;

    protected static string|BackedEnum|null $navigationIcon = \Filament\Support\Icons\Heroicon::OutlinedChartBar;

    protected static ?string $navigationLabel = 'قیمت‌های بازار';

    protected static ?string $modelLabel = 'قیمت بازار';

    protected static ?string $pluralModelLabel = 'قیمت‌های بازار';

    protected static string|null|UnitEnum $navigationGroup = 'تنظیمات';

    protected static ?int $navigationSort = 8;

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

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

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