<?php

namespace App\Filament\Resources\Master\Locations;

use App\Filament\Resources\Master\Locations\Pages\ManageLocations;
use App\Filament\Resources\Master\Locations\Schemas\LocationForm;
use App\Filament\Resources\Master\Locations\Tables\LocationTable;
use App\Models\Location;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class LocationResource extends Resource
{
    protected static ?string $model = Location::class;

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

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

    protected static ?string $navigationLabel = 'Lokus';

    protected static ?int $navigationSort = 3;

    protected static ?string $slug = 'master/locations';

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

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

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