<?php

namespace App\Filament\Resources\Publication\Announcements;

use App\Filament\Resources\Publication\Announcements\Pages\ManageAnnouncements;
use App\Filament\Resources\Publication\Announcements\Schemas\AnnouncementForm;
use App\Filament\Resources\Publication\Announcements\Tables\AnnouncementTable;
use App\Models\Announcement;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class AnnouncementResource extends Resource
{
    protected static ?string $model = Announcement::class;

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

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

    protected static ?string $navigationLabel = 'Pengumuman';

    protected static ?int $navigationSort = 2;

    protected static ?string $slug = 'publication/announcements';

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

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

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