Skip to content

Commit ab3c1c4

Browse files
scott graysonscott grayson
authored andcommitted
fix: restore row click navigation and improve icon spacing
- Add recordUrl to table to restore row click behavior - Clicking folder rows navigates to folder contents - Clicking file rows opens file view page - Add iconPosition('before') and iconSize('sm') for better icon placement - Add extraAttributes with flex gap for proper spacing between icon and text - Icons now have proper padding before the filename
1 parent 4c6f54a commit ab3c1c4

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/Resources/LibraryItemResource.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ public static function table(Table $table): Table
9797
)
9898
->iconColor(fn (LibraryItem $record): string =>
9999
$record->type === 'folder' ? 'success' : 'gray'
100-
),
100+
)
101+
->iconPosition('before')
102+
->iconSize('sm')
103+
->extraAttributes(['class' => 'flex items-center gap-2']),
101104
Tables\Columns\TextColumn::make('creator.name')
102105
->label('Created By')
103106
->searchable()
@@ -125,7 +128,12 @@ public static function table(Table $table): Table
125128
BulkActionGroup::make([
126129
DeleteBulkAction::make(),
127130
]),
128-
]);
131+
])
132+
->recordUrl(fn (LibraryItem $record): string =>
133+
$record->type === 'folder'
134+
? static::getUrl('index', ['parent' => $record->id])
135+
: static::getUrl('view', ['record' => $record])
136+
);
129137
}
130138

131139
public static function getRelations(): array

0 commit comments

Comments
 (0)