@@ -23,6 +23,12 @@ class ViewLibraryItem extends ViewRecord
2323 public function getTitle (): string
2424 {
2525 $ record = $ this ->getRecord ();
26+
27+ // For external links, show the item name instead of "View External Link"
28+ if ($ record ->type === 'link ' ) {
29+ return $ record ->name ;
30+ }
31+
2632 $ type = match ($ record ->type ) {
2733 'folder ' => 'Folder ' ,
2834 'file ' => 'File ' ,
@@ -52,6 +58,7 @@ protected function getHeaderActions(): array
5258 if ($ this ->getRecord ()->type === 'link ' && $ this ->getRecord ()->external_url ) {
5359 $ actions [] = Action::make ('visit_link ' )
5460 ->label ('Visit Link ' )
61+ ->color ('gray ' )
5562 ->icon ('heroicon-o-arrow-top-right-on-square ' )
5663 ->url (fn () => $ this ->getRecord ()->external_url )
5764 ->openUrlInNewTab ();
@@ -115,18 +122,16 @@ public function infolist(Schema $schema): Schema
115122
116123 return $ schema
117124 ->components ([
118- // Video section for external links that are videos
119- Section::make ('Video ' )
120- ->schema ([
121- VideoEmbed::make ('external_url ' )
122- ->visible (fn () => $ record ->type === 'link ' && $ record ->isVideoUrl ()),
123- ])
125+ // Video for external links that are videos (no card wrapper)
126+ VideoEmbed::make ('external_url ' )
127+ ->hiddenLabel ()
124128 ->visible (fn () => $ record ->type === 'link ' && $ record ->isVideoUrl ())
125129 ->columnSpanFull (),
126130
127131 // Item details section
128- Section::make (' Item Details ' )
132+ Section::make ()
129133 ->schema ([
134+ // Row 1: Name, Type
130135 Grid::make (2 )
131136 ->schema ([
132137 TextEntry::make ('name ' )
@@ -140,26 +145,24 @@ public function infolist(Schema $schema): Schema
140145 default => $ state ,
141146 }),
142147 ]),
143- TextEntry::make ('external_url ' )
144- ->label ('URL ' )
145- ->visible (fn () => $ record ->type === 'link ' ),
146- TextEntry::make ('link_description ' )
147- ->label ('Description ' )
148- ->visible (fn () => $ record ->type === 'link ' && $ record ->link_description ),
148+
149+ // Row 2: Created At, Created By
149150 Grid::make (2 )
150151 ->schema ([
151- TextEntry::make ('creator.name ' )
152- ->label ('Created By ' ),
153152 TextEntry::make ('created_at ' )
154153 ->label ('Created At ' )
155154 ->dateTime (),
156- TextEntry::make ('updater.name ' )
157- ->label ('Modified By ' ),
158- TextEntry::make ('updated_at ' )
159- ->label ('Modified At ' )
160- ->dateTime (),
155+ TextEntry::make ('creator.name ' )
156+ ->label ('Created By ' ),
161157 ]),
162- ]),
158+
159+ // Row 3: Description (full width)
160+ TextEntry::make ('link_description ' )
161+ ->label ('Description ' )
162+ ->visible (fn () => $ record ->type === 'link ' && $ record ->link_description )
163+ ->columnSpanFull (),
164+ ])
165+ ->columnSpanFull (),
163166
164167 // Media section for files
165168 Section::make ('Media ' )
0 commit comments