import React from 'react' ; import { SidebarContainer } from '@/appComponents' ; import { SideTitle } from '@/components' ; import { MdTitle , useSidebar } from '../../utils' ; type Props = { list : MdTitle [ ] ; } ; interface ArticleSidebar { ( props ) : JSX . Element | null ; } const ArticleSidebar = ( { list } ) => { const [ sideList , activeIndex , onChange ] = useSidebar ( list ) ; return ( < SidebarContainer className = "article-sidebar" > < div className = "container" > < SideTitle list = { sideList } onChange = { onChange } activeIndex = { activeIndex } / > < /div> < /SidebarContainer>); } ; export default ArticleSidebar ;