import { useState, FC } from 'react'; import { cn } from '../../../../lib/cn'; import { ChevroneDown } from '../../../../assets/icons/groups'; import { Contest } from '../../../../redux/slices/contests'; import PastContestItem from './PastContestItem'; import UpcoingContestItem from './UpcomingContestItem'; interface ContestsBlockProps { contests: Contest[]; title: string; className?: string; type: 'upcoming' | 'past'; groupId: number; } const ContestsBlock: FC = ({ contests, title, className, type, groupId, }) => { const [active, setActive] = useState(title != 'Скрытые'); return (
{ setActive(!active); }} > {title}
{contests.map((v, i) => { if (type == 'past') { return ( ); } if (type == 'upcoming') { return ( ); } return <>; })}
); }; export default ContestsBlock;