<?php

namespace App\Filament\Resources\Appendices;

use App\Filament\Resources\Appendices\Pages;
use App\Models\Appendix;
use App\Enums\NavigationGroup;
use Filament\Schemas\Schema;
use Filament\Resources\Resource;
use Filament\Tables\Table;
use App\Filament\Resources\Appendices\Schemas\AppendixForm;
use App\Filament\Resources\Appendices\Tables\AppendicesTable;

class AppendixResource extends Resource
{
    protected static array $permissionActions = ["view", "create", "update", "delete", "restore", "forceDelete"];
    protected static ?string $model = Appendix::class;
    protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-document-text';
    protected static string | \UnitEnum | null $navigationGroup = NavigationGroup::TRANSACTION->value;
    protected static ?int $navigationSort = 4;

    protected static ?string $modelLabel = 'Phụ lục';
    protected static ?string $pluralModelLabel = 'Phụ lục HĐ';

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

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

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