<?php

namespace App\Filament\Clusters\Settings\Provinces;

use App\Filament\Clusters\Settings\Provinces\Pages\ManageProvinces;
use App\Filament\Clusters\Settings\Provinces\Schemas\ProvinceForm;
use App\Filament\Clusters\Settings\Provinces\Tables\ProvincesTable;
use App\Filament\Clusters\Settings\SettingsCluster;
use App\Modules\Province\Models\Province;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;

class ProvinceResource extends Resource
{
    protected static ?string $model = Province::class;

    protected static ?string $cluster = SettingsCluster::class;

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

    protected static ?string $recordTitleAttribute = 'name';

    public static function getNavigationGroup(): ?string
    {
        return __('Branches and provinces');
    }

    public static function getModelLabel(): string
    {
        return __('module.province::base.Province');
    }

    public static function getPluralModelLabel(): string
    {
        return __('module.province::base.Provinces');
    }

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

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

    public static function getPages(): array
    {
        return [
            'index' => ManageProvinces::route('/'),
        ];
    }
}
