<?php

namespace App\Filament\Resources\Master\Departments;

use App\Filament\Resources\Master\Departments\Pages\ManageDepartments;
use App\Filament\Resources\Master\Departments\Schemas\DepartmentForm;
use App\Filament\Resources\Master\Departments\Tables\DepartmentTable;
use App\Models\Department;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class DepartmentResource extends Resource
{
    protected static ?string $model = Department::class;

    protected static string|UnitEnum|null $navigationGroup = 'Master';

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

    protected static ?string $navigationLabel = 'OPD';

    protected static ?int $navigationSort = 6;

    protected static ?string $slug = 'master/departments';

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

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

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