import { forwardRef, useImperativeHandle, useRef } from 'react'; import { ArrowLeftIcon } from '../icons/ArrowLeftIcon'; import { ArrowRightIcon } from '../icons/ArrowRightIcon'; import { delay } from 'framer-motion'; export const SliderControls = forwardRef< { left: () => void; right: () => void }, { slidesCount: number; width: number; height: number; slide: number; onLeftClick: () => void; onRightClick: () => void; className?: string; } >( ( { slidesCount, height, width, slide = 0, onLeftClick, onRightClick, className, }, ref, ) => { const length = 2 * Math.PI * (height / 2) + (width - height) * 2; const prevBtnRef = useRef(null); const nextBtnRef = useRef(null); const rectRef = useRef(null); useImperativeHandle(ref, () => ({ left: () => prevBtnRef.current?.click(), right: () => nextBtnRef.current?.click(), })); return (

{Math.round(slide) + 1} из {slidesCount}

); }, );