@@ -28,78 +28,28 @@ export default async function Layout({
2828 where : {
2929 organizationId : orgId ,
3030 } ,
31- include : {
32- user : true ,
33- } ,
3431 } ) ;
3532
36- // Filter in application code to handle multiple roles
3733 const employees = allMembers . filter ( ( member ) => {
3834 const roles = member . role . includes ( "," )
3935 ? member . role . split ( "," )
4036 : [ member . role ] ;
4137 return roles . includes ( "employee" ) ;
4238 } ) ;
43-
44- if ( employees . length === 0 ) {
45- return (
46- < div className = "max-w-[1200px] m-auto" >
47- < Suspense fallback = { < div > Loading...</ div > } >
48- < div className = "mt-8" >
49- < AppOnboarding
50- title = { t ( "app_onboarding.employees.title" ) }
51- description = { t (
52- "app_onboarding.employees.description" ,
53- ) }
54- cta = { t ( "app_onboarding.employees.cta" ) }
55- imageSrc = "/onboarding/people-management.webp"
56- imageAlt = "Employee Management"
57- href = { `/${ orgId } /settings/users` }
58- faqs = { [
59- {
60- questionKey : t (
61- "app_onboarding.employees.faqs.question_1" ,
62- ) ,
63- answerKey : t (
64- "app_onboarding.employees.faqs.answer_1" ,
65- ) ,
66- } ,
67- {
68- questionKey : t (
69- "app_onboarding.employees.faqs.question_2" ,
70- ) ,
71- answerKey : t (
72- "app_onboarding.employees.faqs.answer_2" ,
73- ) ,
74- } ,
75- {
76- questionKey : t (
77- "app_onboarding.employees.faqs.question_3" ,
78- ) ,
79- answerKey : t (
80- "app_onboarding.employees.faqs.answer_3" ,
81- ) ,
82- } ,
83- ] }
84- />
85- </ div >
86- </ Suspense >
87- </ div >
88- ) ;
89- }
39+
9040
9141 return (
9242 < div className = "max-w-[1200px] m-auto" >
9343 < SecondaryMenu
9444 items = { [
95- {
96- path : `/${ orgId } /people` ,
97- label : t ( "people.dashboard.title" ) ,
98- } ,
9945 {
10046 path : `/${ orgId } /people/all` ,
10147 label : t ( "people.title" ) ,
10248 } ,
49+ ...( employees . length > 0 ? [ {
50+ path : `/${ orgId } /people/dashboard` ,
51+ label : t ( "people.dashboard.title" ) ,
52+ } ] : [ ] ) ,
10353 ] }
10454 />
10555
0 commit comments