Skip to content

Commit cb50aba

Browse files
committed
placement edit
1 parent 4df719e commit cb50aba

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

frontend/src/components/pages/participants/ParticipantsPage.tsx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,41 @@ const ParticipantsPage = (): React.ReactElement => {
9292
<Spinner />
9393
) : getCurrentParticipantsError ? (
9494
<Flex>{getCurrentParticipantsError.message}</Flex>
95-
) : getCurrentParticipantsData.getCurrentParticipants ?
96-
getCurrentParticipantsData.getCurrentParticipants.map((participant: TableData) =>
97-
<CurrentParticipantCard key={participant.participantId} roomNumber={participant.roomNumber} participantId={participant.participantId} arrival={participant.arrival} password={participant.password} />
98-
)
99-
: (
100-
<Flex>An unknown issue has occured.</Flex>
95+
) : getCurrentParticipantsData?.getCurrentParticipants ? (
96+
<Flex
97+
w="100%"
98+
alignItems="center"
99+
gap="15px"
100+
justifyContent="space-between"
101+
wrap="wrap"
102+
>
103+
{[...Array(10)].map((_, index) => {
104+
const roomNumber = (index + 1).toString();
105+
const participant = getCurrentParticipantsData.getCurrentParticipants.find(
106+
(p: TableData) => p.roomNumber === roomNumber
107+
);
108+
109+
return participant ? (
110+
<CurrentParticipantCard
111+
key={roomNumber}
112+
roomNumber={roomNumber}
113+
participantId={participant.participantId}
114+
arrival={participant.arrival}
115+
password={participant.password}
116+
/>
117+
) : (
118+
<CurrentParticipantCard
119+
key={roomNumber}
120+
roomNumber={roomNumber}
121+
participantId="edit"
122+
arrival="edit"
123+
password="edit"
124+
/>
125+
);
126+
})}
127+
</Flex>
128+
) : (
129+
<Flex>An unknown issue has occurred.</Flex>
101130
)}
102131
</Flex>
103132
<Flex

0 commit comments

Comments
 (0)