import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline'; import { classNames } from '../helpers'; const { useState, useRef, useEffect } = wp.element; const SuggestedKeywords = ( { className, keywordClassName, keywords, onClick, ...props } ) => { const [ scrollPosition, setScrollPosition ] = useState( 0 ); const [ showLeftArrow, setShowLeftArrow ] = useState( false ); const [ showRightArrow, setShowRightArrow ] = useState( false ); const containerRef = useRef( null ); useEffect( () => { if ( ! containerRef.current ) { return; } const { scrollWidth, clientWidth } = containerRef.current; setShowLeftArrow( scrollPosition > 0 ); setShowRightArrow( scrollPosition < scrollWidth - clientWidth ); }, [ keywords, scrollPosition ] ); const handleOnClick = ( keyword ) => () => { if ( typeof onClick === 'function' ) { onClick( keyword ); } }; const handleScroll = ( event ) => { const { scrollLeft, scrollWidth, clientWidth } = event.target; setScrollPosition( scrollLeft ); setShowLeftArrow( scrollLeft > 0 ); setShowRightArrow( scrollLeft < scrollWidth - clientWidth ); }; const scrollTo = ( element, position ) => { if ( ! element ) { return; } element.scrollTo( { left: position, behavior: 'smooth', } ); }; const handleLeftArrowClick = () => { scrollTo( containerRef.current, 0 ); }; const handleRightArrowClick = () => { const container = containerRef.current; scrollTo( container, container.scrollWidth ); }; return (
{ showLeftArrow && (
) }
{ keywords.map( ( keyword, index ) => ( ) ) }
{ showRightArrow && (
) }
); }; export default SuggestedKeywords; Shelly\’s Kleen Tobacco – Contact – AMS Hosting

WARNING: This product contains nicotine. Nicotine is an addictive chemical.


\"\"



\"\"

Call or Visit Shelly\’s Kleen Tobacco Today!

Have Any Questions?

Fill out the form below!

Come Visit Us Today!


Facebook


Google-plus-g

Our Business Hours

MONDAY: 10AM – 5PM

TUESDAY: 10AM – 5PM

WEDNESDAY:  CLOSED

THURSDAY: 10AM – 5PM

FRIDAY: 11AM – 6PM

SATURDAY: 12PM – 5PM

SUNDAY: CLOSED


\"\"

Scroll to Top