<?php

declare(strict_types=1);

namespace TechnoArtisan\FilamentCms\Filament\Admin\Resources\Users;

use App\Models\User;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Override;
use TechnoArtisan\FilamentCms\Filament\Admin\Resources\Users\Pages\CreateUser;
use TechnoArtisan\FilamentCms\Filament\Admin\Resources\Users\Pages\EditUser;
use TechnoArtisan\FilamentCms\Filament\Admin\Resources\Users\Pages\ListUsers;
use TechnoArtisan\FilamentCms\Filament\Admin\Resources\Users\Schemas\UserForm;
use TechnoArtisan\FilamentCms\Filament\Admin\Resources\Users\Tables\UsersTable;
use UnitEnum;

class UserResource extends Resource
{
    protected static string|null $model = User::class;

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

    protected static ?int $navigationSort = 2;

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

    protected static ?string $breadcrumb = 'Benutzer';

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

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

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

    #[Override]
    final public static function getPages(): array
    {
        return [
            'index'  => ListUsers::route('/'),
            'create' => CreateUser::route('/create'),
            'edit'   => EditUser::route('/{record}/edit'),
        ];
    }
}
