2024-12-27 12:52:55 +00:00
|
|
|
import { LotteryWinnerData, LotteryWinnerDataSimplified } from '@/typings/lottery/lottery.types';
|
2024-12-25 13:46:20 +00:00
|
|
|
import LotteryWinner from './LotteryWinner';
|
2024-12-27 15:23:39 +00:00
|
|
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
|
|
|
import { v4 } from 'uuid';
|
2024-11-25 14:33:01 +00:00
|
|
|
|
2024-12-27 12:52:55 +00:00
|
|
|
const LotteryWinnersList = ({ winners }: { winners: LotteryWinnerDataSimplified[] }) => {
|
2024-11-25 14:33:01 +00:00
|
|
|
return (
|
2024-12-25 13:46:20 +00:00
|
|
|
<div className="flex flex-col gap-4 w-full max-w-[1028px]">
|
2024-12-27 15:23:39 +00:00
|
|
|
<div className="flex flex-col gap-2 w-full md:pb-4 pb-3 border-b border-[#CECCFF]">
|
2024-12-25 13:46:20 +00:00
|
|
|
<h4 className="font-heading-3-regular">Results</h4>
|
|
|
|
|
<p className="font-base-medium">The results after each stage will be shown here.</p>
|
|
|
|
|
</div>
|
2024-12-27 15:23:39 +00:00
|
|
|
<motion.div
|
|
|
|
|
layout
|
|
|
|
|
className="grid grid-cols-3 gap-x-2 gap-y-4 w-full h-[244px] overflow-y-auto lottery-scrollbar">
|
|
|
|
|
<AnimatePresence mode="popLayout">
|
|
|
|
|
{winners.map((item, index) => (
|
|
|
|
|
<LotteryWinner
|
|
|
|
|
key={v4()}
|
|
|
|
|
phone={item.client}
|
|
|
|
|
ticket={item.ticket}
|
2024-12-27 16:20:13 +00:00
|
|
|
winnerNumber={item.winner_no}
|
2024-12-27 15:23:39 +00:00
|
|
|
isNew={index === winners.length - 1}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</AnimatePresence>
|
|
|
|
|
</motion.div>
|
2024-11-25 14:33:01 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default LotteryWinnersList;
|