<?php

namespace App\Filament\Resources\Monitoring\ContentRecaps;

use App\Filament\Resources\Monitoring\ContentRecaps\Pages\CreateContentRecap;
use App\Filament\Resources\Monitoring\ContentRecaps\Pages\EditContentRecap;
use App\Filament\Resources\Monitoring\ContentRecaps\Pages\ListContentRecaps;
use App\Filament\Resources\Monitoring\ContentRecaps\Schemas\ContentRecapForm;
use App\Filament\Resources\Monitoring\ContentRecaps\Tables\ContentRecapsTable;
use App\Models\ContentRecap;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use UnitEnum;

class ContentRecapResource extends Resource
{
    protected static ?string $model = ContentRecap::class;

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

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

    protected static ?string $navigationLabel = 'Rekap Konten';

    protected static ?int $navigationSort = 3;

    protected static ?string $recordTitleAttribute = 'title';

    protected static ?string $slug = 'monitoring/content-recaps';

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

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

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

    public static function getRecordRouteBindingEloquentQuery(): Builder
    {
        return parent::getRecordRouteBindingEloquentQuery()
            ->withoutGlobalScopes([
                SoftDeletingScope::class,
            ]);
    }
}
