<?php

namespace App\Filament\Resources\WeeklyForecasts;

use App\Filament\NavigationGroup;
use App\Filament\Resources\WeeklyForecasts\Pages\ListWeeklyForecasts;
use App\Filament\Resources\WeeklyForecasts\Pages\ViewWeeklyForecast;
use App\Filament\Resources\WeeklyForecasts\Schemas\WeeklyForecastInfolist;
use App\Filament\Resources\WeeklyForecasts\Tables\WeeklyForecastsTable;
use App\Models\WeeklyForecast;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;

class WeeklyForecastResource extends Resource
{
    protected static ?string $model = WeeklyForecast::class;

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

    protected static string|\UnitEnum|null $navigationGroup = NavigationGroup::Forecasting;

    protected static ?string $navigationLabel = 'Weekly Forecasts';

    protected static ?int $navigationSort = 2;

    public static function infolist(Schema $schema): Schema
    {
        return WeeklyForecastInfolist::configure($schema);
    }

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

    public static function canCreate(): bool
    {
        return false;
    }

    public static function canEdit(Model $record): bool
    {
        return false;
    }

    public static function canDelete(Model $record): bool
    {
        return false;
    }

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