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; WW Tree Expert – Reviews – AMS Hosting


Facebook


Yelp


Google-plus-g


(321) 302-5281

\"\"

Local. Family Owned. Trusted

Reviews

Get a Free Quote

Call Today for Professional Cocoa Tree Service!

Choose WW Tree Expert as your go-to tree service in Cocoa, FL and surrounding areas for expert care, top-notch safety standards, comprehensive services, customer satisfaction, and the peace of mind that comes with a licensed and insured company. Our experienced team of professionals is dedicated to providing exceptional service and ensuring your trees receive the best possible care.


Book a Free Quote

We ❤️ Our Customers

Call Us Today for a Free Quote!

We want to earn your business and create the space of your dreams. 


Call (321) 302-5281

GET A FREE QUOTE


Click For Quote


Click To Call

\"\"

Click For Quote

  • WW Tree Expert
  • Cocoa, FL 32927
  • (321) 302-5281

We Service:

Cocoa, Cocoa Beach, Merritt Island, Rockledge, Titusville and the surrounding areas


Facebook


Yelp


Google-plus-g

Scroll to Top