Skip to content

Commit 4c6f54a

Browse files
scott graysonscott grayson
authored andcommitted
feat: clean up table view with icons and simplified columns
- Remove view action from table (clicking row still works for navigation) - Remove parent folder column from table - Remove type column from table - Add folder/file icons to name column - Green folder icon for folders, gray document icon for files - Keep only essential columns: name (with icon), created by, timestamps - Cleaner, more focused table interface
1 parent 3941cad commit 4c6f54a

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

src/Resources/LibraryItemResource.php

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Filament\Tables;
88
use Filament\Tables\Table;
99
use Filament\Actions\EditAction;
10-
use Filament\Actions\ViewAction;
1110
use Filament\Actions\BulkActionGroup;
1211
use Filament\Actions\DeleteBulkAction;
1312
use Tapp\FilamentLibrary\Models\LibraryItem;
@@ -92,17 +91,13 @@ public static function table(Table $table): Table
9291
->columns([
9392
Tables\Columns\TextColumn::make('name')
9493
->searchable()
95-
->sortable(),
96-
Tables\Columns\TextColumn::make('type')
97-
->badge()
98-
->color(fn (string $state): string => match ($state) {
99-
'folder' => 'success',
100-
'file' => 'info',
101-
}),
102-
Tables\Columns\TextColumn::make('parent.name')
103-
->label('Parent Folder')
104-
->searchable()
105-
->sortable(),
94+
->sortable()
95+
->icon(fn (LibraryItem $record): string =>
96+
$record->type === 'folder' ? 'heroicon-o-folder' : 'heroicon-o-document'
97+
)
98+
->iconColor(fn (LibraryItem $record): string =>
99+
$record->type === 'folder' ? 'success' : 'gray'
100+
),
106101
Tables\Columns\TextColumn::make('creator.name')
107102
->label('Created By')
108103
->searchable()
@@ -124,12 +119,6 @@ public static function table(Table $table): Table
124119
]),
125120
])
126121
->actions([
127-
ViewAction::make()
128-
->url(fn (LibraryItem $record): string =>
129-
$record->type === 'folder'
130-
? static::getUrl('index', ['parent' => $record->id])
131-
: static::getUrl('view', ['record' => $record])
132-
),
133122
EditAction::make(),
134123
])
135124
->bulkActions([

0 commit comments

Comments
 (0)