1- import { Icon } from '@webkom/lego-bricks' ;
1+ import { Flex , Icon } from '@webkom/lego-bricks' ;
22import {
33 Home ,
44 CircleUser ,
@@ -19,11 +19,13 @@ import {
1919 LogOut ,
2020} from 'lucide-react' ;
2121import { navigate } from 'vike/client/router' ;
22+ import Tag from '~/components/Tags/Tag' ;
2223import { logout } from '~/redux/actions/UserActions' ;
2324
2425type Command = {
2526 id : string ;
26- label : string ;
27+ renderLabel : string | React . ReactNode ;
28+ searchText : string ;
2729 action : ( ) => void ;
2830 icon ?: React . ReactNode ;
2931} ;
@@ -43,91 +45,110 @@ const createCommands = (
4345 items : [
4446 {
4547 id : 'home' ,
46- label : 'Hjem' ,
48+ renderLabel : 'Hjem' ,
49+ searchText : 'Hjem' ,
4750 action : ( ) => navigate ( '/' ) ,
4851 icon : < Icon iconNode = { < Home /> } size = { 15 } /> ,
4952 } ,
5053 {
5154 id : 'profile' ,
52- label : 'Profil' ,
55+ renderLabel : 'Profil' ,
56+ searchText : 'Profil' ,
5357 action : ( ) => navigate ( '/users/me' ) ,
5458 icon : < Icon iconNode = { < CircleUser /> } size = { 15 } /> ,
5559 } ,
5660 {
5761 id : 'events' ,
58- label : 'Arrangementer' ,
62+ renderLabel : 'Arrangementer' ,
63+ searchText : 'Arrangementer' ,
5964 action : ( ) => navigate ( '/events' ) ,
6065 icon : < Icon iconNode = { < CalendarRange /> } size = { 15 } /> ,
6166 } ,
6267 {
6368 id : 'meetings' ,
64- label : 'Møter' ,
69+ renderLabel : 'Møter' ,
70+ searchText : 'Møter' ,
6571 action : ( ) => navigate ( '/meetings' ) ,
6672 icon : < Icon iconNode = { < Users /> } size = { 15 } /> ,
6773 } ,
6874 {
6975 id : 'lending' ,
70- label : 'Utlån' ,
76+ renderLabel : (
77+ < Flex alignItems = "center" gap = { 10 } >
78+ Utlån < Tag tag = "Nytt!!" color = "pink" />
79+ </ Flex >
80+ ) ,
81+ searchText : 'Utlån' ,
7182 action : ( ) => navigate ( '/lending' ) ,
7283 icon : < Icon iconNode = { < ShoppingCart /> } size = { 15 } /> ,
7384 } ,
7485 {
7586 id : 'interestGroups' ,
76- label : 'Interessegrupper' ,
87+ renderLabel : 'Interessegrupper' ,
88+ searchText : 'Interessegrupper' ,
7789 action : ( ) => navigate ( '/interest-groups' ) ,
7890 icon : < Icon iconNode = { < Banana /> } size = { 15 } /> ,
7991 } ,
8092 {
8193 id : 'joblistings' ,
82- label : 'Jobbannonser' ,
94+ renderLabel : 'Jobbannonser' ,
95+ searchText : 'Jobbannonser' ,
8396 action : ( ) => navigate ( '/joblistings' ) ,
8497 icon : < Icon iconNode = { < Newspaper /> } size = { 15 } /> ,
8598 } ,
8699 {
87100 id : 'companies' ,
88- label : 'Bedrifter' ,
101+ renderLabel : 'Bedrifter' ,
102+ searchText : 'Bedrifter' ,
89103 action : ( ) => navigate ( '/companies' ) ,
90104 icon : < Icon iconNode = { < Briefcase /> } size = { 15 } /> ,
91105 } ,
92106 {
93107 id : 'articles' ,
94- label : 'Artikler' ,
108+ renderLabel : 'Artikler' ,
109+ searchText : 'Artikler' ,
95110 action : ( ) => navigate ( '/articles' ) ,
96111 icon : < Icon iconNode = { < BookOpen /> } size = { 15 } /> ,
97112 } ,
98113 {
99114 id : 'gallery' ,
100- label : 'Album' ,
115+ renderLabel : 'Album' ,
116+ searchText : 'Album' ,
101117 action : ( ) => navigate ( '/photos' ) ,
102118 icon : < Icon iconNode = { < BookImage /> } size = { 15 } /> ,
103119 } ,
104120 {
105121 id : 'quotes' ,
106- label : 'Overhørt' ,
122+ renderLabel : 'Overhørt' ,
123+ searchText : 'Overhørt' ,
107124 action : ( ) => navigate ( '/quotes' ) ,
108125 icon : < Icon iconNode = { < Quote /> } size = { 15 } /> ,
109126 } ,
110127 {
111128 id : 'trophies' ,
112- label : 'Trofeer' ,
129+ renderLabel : 'Trofeer' ,
130+ searchText : 'Trofeer' ,
113131 action : ( ) => navigate ( '/achievements' ) ,
114132 icon : < Icon iconNode = { < Trophy /> } size = { 15 } /> ,
115133 } ,
116134 {
117135 id : 'theFund' ,
118- label : 'Fondet' ,
136+ renderLabel : 'Fondet' ,
137+ searchText : 'Fondet' ,
119138 action : ( ) => window . open ( 'https://fondet.abakus.no/' , '_blank' ) ,
120139 icon : < Icon iconNode = { < Landmark /> } size = { 15 } /> ,
121140 } ,
122141 {
123142 id : 'developerBlog' ,
124- label : 'Utviklerbloggen' ,
143+ renderLabel : 'Utviklerbloggen' ,
144+ searchText : 'Utviklerbloggen' ,
125145 action : ( ) => window . open ( 'https://webkom.dev/' , '_blank' ) ,
126146 icon : < Icon iconNode = { < MessageSquareQuote /> } size = { 15 } /> ,
127147 } ,
128148 {
129149 id : 'settings' ,
130- label : 'Innstillinger' ,
150+ renderLabel : 'Innstillinger' ,
151+ searchText : 'Innstillinger' ,
131152 action : ( ) => navigate ( '/users/me/settings/profile' ) ,
132153 icon : < Icon iconNode = { < Settings /> } size = { 15 } /> ,
133154 } ,
@@ -138,25 +159,29 @@ const createCommands = (
138159 items : [
139160 {
140161 id : 'createMeetingNotice' ,
141- label : 'Lag møteinnkalling' ,
162+ renderLabel : 'Lag møteinnkalling' ,
163+ searchText : 'Lag møteinnkalling' ,
142164 action : ( ) => navigate ( '/meetings/new' ) ,
143165 icon : < Icon iconNode = { < Terminal /> } size = { 15 } /> ,
144166 } ,
145167 {
146168 id : 'createReceipt' ,
147- label : 'Lag kvittering' ,
169+ renderLabel : 'Lag kvittering' ,
170+ searchText : 'Lag kvittering' ,
148171 action : ( ) => window . open ( 'https://kvittering.abakus.no/' , '_blank' ) ,
149172 icon : < Icon iconNode = { < Terminal /> } size = { 15 } /> ,
150173 } ,
151174 {
152175 id : 'createQuote' ,
153- label : 'Lag sitat' ,
176+ renderLabel : 'Lag sitat' ,
177+ searchText : 'Lag sitat' ,
154178 action : ( ) => navigate ( '/quotes/new' ) ,
155179 icon : < Icon iconNode = { < Terminal /> } size = { 15 } /> ,
156180 } ,
157181 {
158182 id : 'createAlbum' ,
159- label : 'Lag album' ,
183+ renderLabel : 'Lag album' ,
184+ searchText : 'Lag album' ,
160185 action : ( ) => navigate ( '/photos/new' ) ,
161186 icon : < Icon iconNode = { < Terminal /> } size = { 15 } /> ,
162187 } ,
@@ -167,7 +192,8 @@ const createCommands = (
167192 items : [
168193 {
169194 id : 'logout' ,
170- label : 'Logg ut' ,
195+ renderLabel : 'Logg ut' ,
196+ searchText : 'Logg ut' ,
171197 icon : < Icon iconNode = { < LogOut /> } size = { 15 } /> ,
172198 action : ( ) => {
173199 dispatch ( logout ( ) ) ;
0 commit comments