<?php

namespace App\Filament\Resources\RoleTemplates;

use App\Filament\Resources\RoleTemplates\Pages;
use App\Models\RoleTemplate;
use App\Enums\NavigationGroup;
use Filament\Schemas\Schema;
use Filament\Resources\Resource;
use Filament\Tables\Table;
use App\Filament\Resources\RoleTemplates\Schemas\RoleTemplateForm;
use App\Filament\Resources\RoleTemplates\Tables\RoleTemplatesTable;

class RoleTemplateResource extends Resource
{
    protected static ?string $model = RoleTemplate::class;
    protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-shield-check';
    protected static string | \UnitEnum | null $navigationGroup = NavigationGroup::SETTING->value;
    protected static ?int $navigationSort = 90;

    protected static ?string $modelLabel = 'Mẫu phân quyền';
    protected static ?string $pluralModelLabel = 'Mẫu phân quyền';

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

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

    public static function getPages(): array
    {
        return [
            'index' => Pages\ListRoleTemplates::route('/'),
            'create' => Pages\CreateRoleTemplate::route('/create'),
            'edit' => Pages\EditRoleTemplate::route('/{record}/edit'),
        ];
    }
}
