diff --git a/src/counter.tsx b/src/counter.tsx deleted file mode 100644 index 5806104a..00000000 --- a/src/counter.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, {useEffect} from 'react'; -import { ArrowBackIcon, ArrowForwardIcon } from '@chakra-ui/icons'; -import { LinkBox, LinkOverlay, HStack, Box, Button, Text } from '@chakra-ui/react'; - -interface propsTS { - count: number - current: number - - onPageChange(e: number): void -} - -export default React.memo(({ - count, - current, - onPageChange, -}: propsTS) => { - - //Проверка, что пришедшие данные валидны - if(count <= 0 || current <= 0) {return Указанные значения ниже нуля} - if(count < current) {return Текущая страница больше общего числа} - - let a = [] - //Создание списка кнопок идёт поэлементно с лева на право - - //Создание кнопки <- - a.push() - } - if (current > 3) { - a.push("...") - } - - //Создание 3 кнопок - - if (current - 1 !== 0) { - a.push() - } - a.push() - if (current + 1 <= count) { - a.push() - } - - //Создание троеточия и последней кнопки - if (current < (count - 2)) { - a.push("...") - a.push() - } - - //Кнопка -> - a.push(