Skip to content

Commit c15b5e6

Browse files
feat: faculty page frontend
1 parent 4c8ee8a commit c15b5e6

File tree

13 files changed

+817
-181
lines changed

13 files changed

+817
-181
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { type Translations } from '~/i18n/translations';
2+
3+
import { FacultySectionComponent } from '../../utils';
4+
5+
export default async function FacultySection({
6+
params: { locale, faculty_section, employee_id: employeeId },
7+
}: {
8+
params: {
9+
locale: string;
10+
faculty_section: keyof Translations['FacultyAndStaff']['tabs'];
11+
employee_id: string;
12+
};
13+
}) {
14+
return (
15+
<FacultySectionComponent
16+
locale={locale}
17+
facultySection={faculty_section}
18+
employeeId={employeeId}
19+
/>
20+
);
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { union } from 'drizzle-orm/pg-core';
2+
import { type ReactNode } from 'react';
3+
4+
import { db, faculty, staff } from '~/server/db';
5+
6+
import { FacultyOrStaffComponent } from '../utils';
7+
8+
export async function generateStaticParams() {
9+
const facultyIds = db
10+
.select({ employee_id: faculty.employeeId })
11+
.from(faculty);
12+
const staffIds = db.select({ employee_id: staff.employeeId }).from(staff);
13+
return await union(facultyIds, staffIds);
14+
}
15+
16+
export default async function FacultyOrStaffLayout({
17+
children,
18+
params: { locale, employee_id },
19+
}: {
20+
children?: ReactNode;
21+
params: { locale: string; employee_id: string };
22+
}) {
23+
return (
24+
<FacultyOrStaffComponent locale={locale} employeeId={employee_id}>
25+
{children}
26+
</FacultyOrStaffComponent>
27+
);
28+
}
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import { union } from 'drizzle-orm/pg-core';
1+
import FacultySection from './[faculty_section]/page';
22

3-
import { WorkInProgressStatus } from '~/components/status';
4-
import { db, faculty, staff } from '~/server/db';
5-
6-
export async function generateStaticParams() {
7-
const facultyIds = db
8-
.select({ employee_id: faculty.employeeId })
9-
.from(faculty);
10-
const staffIds = db.select({ employee_id: staff.employeeId }).from(staff);
11-
return await union(facultyIds, staffIds);
12-
}
13-
14-
export default function FacultyOrStaff({
15-
params: { locale, employee_id: employeeId },
3+
export default function FacultyAndStaff({
4+
params: { locale, employee_id },
165
}: {
176
params: { locale: string; employee_id: string };
187
}) {
19-
return <WorkInProgressStatus locale={locale} />;
8+
return (
9+
<FacultySection
10+
params={{
11+
locale: locale,
12+
faculty_section: 'qualifications',
13+
employee_id: employee_id,
14+
}}
15+
/>
16+
);
2017
}

0 commit comments

Comments
 (0)