import React, { useRef } from 'react'; import { FaqCategory } from 'app/modules/faq/components/faqCategory'; import { selectCategories } from '../store/faq.selectors'; import { useSelector } from 'react-redux'; import { FaqScrollMenu } from './faqScrollMenu'; export const Faq = () => { const categories = useSelector(selectCategories); const ref = useRef(null); const executeScroll = (elementName) => { ref.current?.children.namedItem(elementName)?.scrollIntoView({ behavior: 'smooth' }); }; return (
{categories.length > 1 && } {categories.map(category => ) }
); };