From 6ac386dc69a783e617d0592e8141de32576bf4c4 Mon Sep 17 00:00:00 2001 From: Kakabay <2kakabayashyrberdyew@gmail.com> Date: Thu, 19 Sep 2024 17:17:04 +0500 Subject: [PATCH] participants list fixed --- components/vote/ParticipantsList.tsx | 46 ++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/components/vote/ParticipantsList.tsx b/components/vote/ParticipantsList.tsx index ebe12e8..6903f54 100644 --- a/components/vote/ParticipantsList.tsx +++ b/components/vote/ParticipantsList.tsx @@ -184,6 +184,8 @@ const ParticipantsList = ({ vote_id }: IParams) => { return count; }; + const hasVotes = participantsData.some((item) => item.votes_count > 0); + if (data) { if (!data?.data) { return ( @@ -288,7 +290,7 @@ const ParticipantsList = ({ vote_id }: IParams) => {
{participantsData ? participantsData.map((participant, index) => - participant.votes_count !== participantsData[0].votes_count ? ( + !hasVotes ? ( participant.url ? ( { winner={false} /> ) - ) : null, + ) : ( + participant.votes_count !== participantsData[0].votes_count && + (participant.url ? ( + + + + ) : ( + + )) + ), ) : null}