<?php

namespace App\Filament\Resources\FormQuestionGroups;

use App\Filament\Resources\FormQuestionGroups\Pages\CreateFormQuestionGroup;
use App\Filament\Resources\FormQuestionGroups\Pages\EditFormQuestionGroup;
use App\Filament\Resources\FormQuestionGroups\Pages\ListFormQuestionGroups;
use App\Filament\Resources\FormQuestionGroups\Schemas\FormQuestionGroupForm;
use App\Filament\Resources\FormQuestionGroups\Tables\FormQuestionGroupsTable;
use App\Models\FormQuestionGroup;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;

class FormQuestionGroupResource extends Resource
{
    protected static ?string $model = FormQuestionGroup::class;

    protected static ?string $panel = 'config';

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

    protected static ?string $navigationLabel = 'Question Groups';

    protected static ?int $navigationSort = 9;

    public static function shouldRegisterNavigation(): bool
    {
        return filament()->getCurrentPanel()->getId() === 'config';
    }

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

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

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

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