1
1
<div class =" menu-tree-item" data-item-id =" {{ $item -> id } }" >
2
2
<div class =" flex items-center p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 group hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors {{ $depth > 0 ? ' ml-' . ($depth * 8 ) : ' ' } }" >
3
-
3
+
4
4
@if ($showActions )
5
5
<!-- Drag Handle -->
6
- <div class =" drag-handle cursor-move text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 mr-4 opacity-0 group-hover:opacity-100 transition-opacity " >
6
+ <div class =" drag-handle cursor-move text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 mr-4" >
7
7
<svg class =" w-5 h-5" fill =" none" stroke =" currentColor" viewBox =" 0 0 24 24" >
8
8
<path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 8h16M4 16h16" ></path >
9
9
</svg >
12
12
13
13
<!-- Expand/Collapse Button for items with children -->
14
14
@if ($this -> hasChildren () )
15
- <button
15
+ <button
16
16
type =" button"
17
17
wire:click =" toggleExpanded"
18
18
class =" mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
@@ -30,9 +30,11 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
30
30
<div class =" flex items-center justify-between" >
31
31
<div class =" flex items-center space-x-3" >
32
32
@if ($item -> icon )
33
- <span class =" text-gray-500 text-lg" >{!! $item -> icon ! !} </span >
33
+ <x-filament::icon
34
+ icon =" {{ $item -> icon } }"
35
+ class =" h-5 w-5 text-gray-500 text-lg" />
34
36
@endif
35
-
37
+
36
38
<div >
37
39
<p class =" text-sm font-medium text-gray-900 dark:text-white truncate" >
38
40
{{ $this -> getItemDisplayLabel () } }
@@ -41,7 +43,7 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
41
43
{{ $this -> getItemTypeLabel () } }
42
44
</p >
43
45
</div >
44
-
46
+
45
47
@if (! $item -> is_visible )
46
48
<span class =" inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300" >
47
49
{{ flexiblePagesTrans (' menu_items.status.hidden' ) } }
@@ -56,42 +58,36 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
56
58
<x-filament::button
57
59
color =" gray"
58
60
size =" xs"
61
+ icon =" heroicon-o-plus"
62
+ tooltip =" {{ flexiblePagesTrans (' menu_items.tree.add_child' ) } }"
63
+ label-sr-only =" {{ flexiblePagesTrans (' menu_items.tree.add_child' ) } }"
59
64
wire:click =" mountAction('addChild')"
60
- >
61
- <x-slot name =" icon" >
62
- heroicon-o-plus
63
- </x-slot >
64
- {{ flexiblePagesTrans (' menu_items.tree.add_child' ) } }
65
- </x-filament::button >
65
+ ></x-filament::button >
66
66
@endif
67
-
67
+
68
68
<x-filament::button
69
- color =" primary "
69
+ color =" gray "
70
70
size =" xs"
71
+ icon =" heroicon-o-pencil"
72
+ tooltip =" {{ flexiblePagesTrans (' menu_items.tree.edit' ) } }"
73
+ label-sr-only =" {{ flexiblePagesTrans (' menu_items.tree.edit' ) } }"
71
74
wire:click =" mountAction('edit')"
72
- >
73
- <x-slot name =" icon" >
74
- heroicon-o-pencil
75
- </x-slot >
76
- {{ flexiblePagesTrans (' menu_items.tree.edit' ) } }
77
- </x-filament::button >
78
-
75
+ ></x-filament::button >
76
+
79
77
<x-filament::button
80
78
color =" danger"
81
79
size =" xs"
80
+ icon =" heroicon-o-trash"
81
+ tooltip =" {{ flexiblePagesTrans (' menu_items.tree.delete' ) } }"
82
+ label-sr-only =" {{ flexiblePagesTrans (' menu_items.tree.delete' ) } }"
82
83
wire:click =" mountAction('delete')"
83
- >
84
- <x-slot name =" icon" >
85
- heroicon-o-trash
86
- </x-slot >
87
- {{ flexiblePagesTrans (' menu_items.tree.delete' ) } }
88
- </x-filament::button >
84
+ ></x-filament::button >
89
85
</div >
90
86
@endif
91
87
</div >
92
88
</div >
93
89
</div >
94
-
90
+
95
91
<!-- Children -->
96
92
@if ($this -> hasChildren () && $isExpanded )
97
93
<div class =" space-y-2 mt-2" wire:key =" children-{{ $item -> id } }" >
@@ -101,8 +97,8 @@ class="mr-2 p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 trans
101
97
' depth' => $depth + 1 ,
102
98
' maxDepth' => $maxDepth ,
103
99
' showActions' => $showActions
104
- ], key ( $child -> id ) )
100
+ ], key : $child -> id )
105
101
@endforeach
106
102
</div >
107
103
@endif
108
- </div >
104
+ </div >
0 commit comments