diff --git a/app/(pre-dashboard)/(landing)/sections/Roster.tsx b/app/(pre-dashboard)/(landing)/sections/Roster.tsx new file mode 100644 index 0000000..cb99b5c --- /dev/null +++ b/app/(pre-dashboard)/(landing)/sections/Roster.tsx @@ -0,0 +1,96 @@ +import React from 'react'; + +type Member = { + name: string; +}; + +type Team = { + title: string; + members: Member[]; +}; + +type SemesterRoster = { + semester: string; + teams: Team[]; +}; + +const parseRosterData = (input: string): SemesterRoster[] => { + const semesters = input.split(/\n(?=Semester: )/g).filter(Boolean); + return semesters.map((semesterText) => { + const [semesterLine, ...teamLines] = semesterText.trim().split('\n'); + const semester = semesterLine.replace('Semester: ', '').trim(); + + const teams = teamLines + .join('\n') + .split(/\n(?=Team: )/g) + .filter(Boolean) + .map((teamText) => { + const [teamLine, ...memberLines] = teamText.trim().split('\n'); + const title = teamLine.replace('Team: ', '').trim(); + + const members = memberLines + .map((line) => ({ name: line.replace(/^\s*-\s*/, '').trim() })) + .filter(Boolean); + + return { title, members }; + }); + + return { semester, teams }; + }); +}; + +const rosterText = ` +Semester: Fall 2024 +Team: Executive Directors + - Rushd Syed '25 + - Shivam Kajaria '25 +Team: Logistics +Team: Marketing +Team: Day-of +Team: Design +Team: Finance +Team: RnD + - Kevin Monisit '25 | Director + - Andrew Somers '26 | Frontend Lead + - Ethan Nyugen '25 | Backend Lead + - Ayoob Florival + - Rishab + - Sana Naik + - Yogesh Sampathkumar + - Eshaan +`; + +const rosterData = parseRosterData(rosterText); + +const TeamRoster = () => { + return ( +
+

Our Team

+ {rosterData.map((semester) => ( +
+

+ {semester.semester} +

+ {semester.teams.map((team) => ( +
+

{team.title}:

+
    + {team.members.length > 0 ? ( + team.members.map((member, index) => ( +
  • + {member.name} +
  • + )) + ) : ( +
  • No members listed
  • + )} +
+
+ ))} +
+ ))} +
+ ); +}; + +export default TeamRoster; diff --git a/app/(pre-dashboard)/offseason/page.tsx b/app/(pre-dashboard)/offseason/page.tsx index 8380bb7..92c72e2 100644 --- a/app/(pre-dashboard)/offseason/page.tsx +++ b/app/(pre-dashboard)/offseason/page.tsx @@ -3,6 +3,7 @@ import { useState } from 'react'; import Image from 'next/image'; import { Button } from '@/app/ui/button'; +import TeamRoster from '../(landing)/sections/Roster'; export default function ComingSoonPage() { return ( @@ -51,9 +52,11 @@ export default function ComingSoonPage() { + +