<?php

namespace App\Filament\Resources\PerformanceRuns;

use App\Filament\Resources\PerformanceRuns\Pages\CreatePerformanceRun;
use App\Filament\Resources\PerformanceRuns\Pages\EditPerformanceRun;
use App\Filament\Resources\PerformanceRuns\Pages\ListPerformanceRuns;
use App\Filament\Resources\PerformanceRuns\Schemas\PerformanceRunForm;
use App\Filament\Resources\PerformanceRuns\Tables\PerformanceRunsTable;
use App\Models\PerformanceRun;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;

class PerformanceRunResource extends Resource
{
    protected static ?string $model = PerformanceRun::class;

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

    protected static ?string $recordTitleAttribute = 'theater';

    protected static ?string $navigationLabel = '上演日程';
    protected static ?string $modelLabel = '上演日程';
    protected static ?string $pluralModelLabel = '上演日程一覧';
    protected static string | \UnitEnum | null $navigationGroup = '公演管理';
    protected static ?int $navigationSort = 2;

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

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

    public static function getRelations(): array
    {
        return [
            //
        ];
    }

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