components([ Section::make('Fájl információk') ->poll('5s') ->schema([ Grid::make(3) ->schema([ TextEntry::make('filename') ->label('Fájlnév') ->icon('heroicon-o-document-text') ->color('primary'), TextEntry::make('supplier.name') ->label('Beszállító') ->icon('heroicon-o-user'), TextEntry::make('status') ->label('Státusz') ->badge() ->formatStateUsing(fn (PricelistFileStatusEnum $state): string => $state->label()) ->color(fn (PricelistFileStatusEnum $state): string => match ($state) { PricelistFileStatusEnum::todo => 'gray', PricelistFileStatusEnum::inprogress => 'info', PricelistFileStatusEnum::done => 'success', PricelistFileStatusEnum::fail => 'danger', PricelistFileStatusEnum::waiting_for_approval => 'primary', PricelistFileStatusEnum::closed => 'warning', }), ]), Grid::make(3) ->schema([ TextEntry::make('available_date') ->label('Életbelépés dátuma') ->date('Y.m.d'), TextEntry::make('created_at') ->label('Feltöltés időpontja') ->dateTime('Y.m.d H:i'), TextEntry::make('processing_current_step') ->label('Aktuális folyamat') ->weight('bold') ->color('info') ->formatStateUsing(fn ($state, $record) => "$state ({$record->processing_current_step_percentage}%)"), ]), TextEntry::make('note') ->label('Megjegyzés') ->placeholder('Nincs megjegyzés') ->columnSpanFull(), ]), Section::make('Feldolgozási folyamat (Workflow)') ->poll('5s') ->schema([ RepeatableEntry::make('workflow_steps') ->label(false) ->schema([ TextEntry::make('label') ->label('Lépés') ->weight('bold') ->inlineLabel(), TextEntry::make('status') ->label('Állapot') ->badge() ->inlineLabel() ->formatStateUsing(fn (string $state): string => match ($state) { 'pending' => 'várakozik', 'inprogress' => 'folyamatban', 'done' => 'kész', 'fail' => 'hiba', default => $state, }) ->color(fn (string $state): string => match ($state) { 'pending' => 'gray', 'inprogress' => 'info', 'done' => 'success', 'fail' => 'danger', default => 'gray', }) ->icon(fn (string $state): string => match ($state) { 'pending' => 'heroicon-o-clock', 'inprogress' => 'heroicon-o-arrow-path', 'done' => 'heroicon-o-check-circle', 'fail' => 'heroicon-o-x-circle', default => 'heroicon-o-question-mark-circle', }), ]) ->columns(2) ->columnSpanFull(), ]), ]); } }