@@ -185,13 +185,16 @@ function CompanyDashboardContent({
185185 }
186186
187187 // Generate sidebar items with dynamic company slug
188+ // Use currentCompany.slug as fallback when companySlug from params is undefined
189+ const effectiveSlug = companySlug || currentCompany . slug
190+
188191 const sidebarItems : SidebarGroupType [ ] = [
189192 {
190193 title : 'Dashboard' ,
191194 items : [
192195 {
193196 title : 'Overview' ,
194- url : `/dashboard/company/${ companySlug } ` ,
197+ url : `/dashboard/company/${ effectiveSlug } ` ,
195198 icon : LayoutDashboard ,
196199 } ,
197200 ] ,
@@ -201,17 +204,17 @@ function CompanyDashboardContent({
201204 items : [
202205 {
203206 title : 'Events' ,
204- url : `/dashboard/company/${ companySlug } /events` ,
207+ url : `/dashboard/company/${ effectiveSlug } /events` ,
205208 icon : Calendar ,
206209 } ,
207210 {
208211 title : 'Hackathons' ,
209- url : `/dashboard/company/${ companySlug } /hackathons` ,
212+ url : `/dashboard/company/${ effectiveSlug } /hackathons` ,
210213 icon : Trophy ,
211214 } ,
212215 {
213216 title : 'Team' ,
214- url : `/dashboard/company/${ companySlug } /team` ,
217+ url : `/dashboard/company/${ effectiveSlug } /team` ,
215218 icon : Users ,
216219 } ,
217220 ] ,
@@ -221,7 +224,7 @@ function CompanyDashboardContent({
221224 items : [
222225 {
223226 title : 'Analytics' ,
224- url : `/dashboard/company/${ companySlug } /analytics` ,
227+ url : `/dashboard/company/${ effectiveSlug } /analytics` ,
225228 icon : BarChart3 ,
226229 } ,
227230 ] ,
@@ -231,12 +234,12 @@ function CompanyDashboardContent({
231234 items : [
232235 {
233236 title : 'Company Settings' ,
234- url : `/dashboard/company/${ companySlug } /settings` ,
237+ url : `/dashboard/company/${ effectiveSlug } /settings` ,
235238 icon : Settings ,
236239 } ,
237240 {
238241 title : 'Subscription' ,
239- url : `/dashboard/company/${ companySlug } /subscription` ,
242+ url : `/dashboard/company/${ effectiveSlug } /subscription` ,
240243 icon : CreditCard ,
241244 } ,
242245 ] ,
0 commit comments