<?php

declare(strict_types=1);

namespace App\Filament\Resources\Discussions;

use App\Filament\Resources\Discussions\Pages\CreateDiscussion;
use App\Filament\Resources\Discussions\Pages\EditDiscussion;
use App\Filament\Resources\Discussions\Pages\ListDiscussions;
use App\Models\Discussion;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
use UnitEnum;

class DiscussionResource extends Resource
{
    protected static ?string $model = Discussion::class;

    protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-chat-bubble-bottom-center-text';

    protected static ?string $navigationLabel = 'بحث‌های موضوعی';

    protected static ?string $modelLabel = 'بحث';

    protected static ?string $pluralModelLabel = 'بحث‌های موضوعی';

    protected static string|null|UnitEnum $navigationGroup = 'پشتیبانی';

    protected static ?string $recordTitleAttribute = 'title';

    public static function form(Schema $schema): Schema
    {
        return \App\Filament\Resources\Discussions\Schemas\DiscussionForm::configure($schema);
    }

    public static function table(Table $table): Table
    {
        return \App\Filament\Resources\Discussions\Tables\DiscussionsTable::configure($table);
    }

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