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 ( +
{team.title}:
+