Skip to content

Commit

Permalink
Fix rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag committed Jun 7, 2024
1 parent 0adbbd2 commit 8c38362
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ function ResultsTable({ $expanded, option, onClick, cycleId, eventId }: ResultsT
enabled: !!option.id,
});

const coauthors = optionUsers?.group?.users?.map((user) => `${user.firstName} ${user.lastName}`);
console.log('🚀 ~ ResultsTable ~ coauthors:', coauthors);
const collaborators = optionUsers?.group?.users
?.filter(
(user) =>
user.firstName !== optionUsers?.user?.firstName ||
user.lastName !== optionUsers?.user?.lastName,
)
.map((user) => `${user.firstName} ${user.lastName}`);

const handleCommentsClick = () => {
navigate(`/events/${eventId}/cycles/${cycleId}/options/${option.id}`);
Expand Down Expand Up @@ -90,7 +95,8 @@ function ResultsTable({ $expanded, option, onClick, cycleId, eventId }: ResultsT
<Bold>Lead Author:</Bold> {optionUsers?.user?.firstName} {optionUsers?.user?.lastName}
</Body>
<Body>
<Bold>Collaborators</Bold> {coauthors}
<Bold>Collaborators:</Bold>{' '}
{collaborators && collaborators.length > 0 ? collaborators.join(', ') : 'None'}
</Body>
<Body>
<Bold>Distinct voters:</Bold> {option.distinctUsers}
Expand Down

0 comments on commit 8c38362

Please sign in to comment.