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