<?php

namespace App\Filament\Resources\NewsCategories;

use App\Filament\Resources\NewsCategories\Pages\CreateNewsCategories;
use App\Filament\Resources\NewsCategories\Pages\CreateNewsCategory;
use App\Filament\Resources\NewsCategories\Pages\EditNewsCategories;
use App\Filament\Resources\NewsCategories\Pages\EditNewsCategory;
use App\Filament\Resources\NewsCategories\Pages\ListNewsCategories;
use App\Filament\Resources\NewsCategories\Schemas\NewsCategoriesForm;
use App\Filament\Resources\NewsCategories\Schemas\NewsCategoryForm;
use App\Filament\Resources\NewsCategories\Tables\NewsCategoriesTable;
use App\Models\NewsCategory;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;

class NewsCategoriesResource extends Resource
{
    protected static ?string $model = NewsCategory::class;

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

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

    public static function getLabel(): ?string
    {
        return 'Kategori Berita';
    }

    protected static ?string $recordTitleAttribute = 'NewsCategory';

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

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

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

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