<?php

namespace App\Filament\Resources\Authors;

use App\Filament\Resources\Authors\Pages\CreateAuthor;
use App\Filament\Resources\Authors\Pages\CreateAuthors;
use App\Filament\Resources\Authors\Pages\EditAuthor;
use App\Filament\Resources\Authors\Pages\EditAuthors;
use App\Filament\Resources\Authors\Pages\ListAuthors;
use App\Filament\Resources\Authors\Schemas\AuthorForm;
use App\Filament\Resources\Authors\Schemas\AuthorsForm;
use App\Filament\Resources\Authors\Tables\AuthorsTable;
use App\Models\Author;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;

class AuthorsResource extends Resource
{
    protected static ?string $model = Author::class;

    protected static string|BackedEnum|null $navigationIcon = Heroicon::Users;
    protected static string|\UnitEnum|null $navigationGroup = 'Berita & Informasi';
    protected static ?string $navigationLabel = 'Penulis';

    public static function getPluralLabel(): ?string
    {
        return 'Penulis';
    }

    public static function getLabel(): ?string
    {
        return 'Penulis';
    }
    protected static ?string $recordTitleAttribute = 'Author';

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

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

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

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