import React, {useEffect, useRef} from 'react'; import type {TabProps} from '../../typings/hyper'; const Tab = (props: TabProps) => { const handleClick = (event: React.MouseEvent) => { const isLeftClick = event.nativeEvent.which === 1; if (isLeftClick && !props.isActive) { props.onSelect(); } }; const handleMouseUp = (event: React.MouseEvent) => { const isMiddleClick = event.nativeEvent.which === 2; if (isMiddleClick) { props.onClose(); } }; const ref = useRef(null); useEffect(() => { if (props.lastFocused) { ref?.current?.scrollIntoView({ behavior: 'smooth' }); } }, [props.lastFocused]); const {isActive, isFirst, isLast, borderColor, hasActivity} = props; return ( <>
  • {props.customChildrenBefore} {props.text} {props.customChildren}
  • ); }; Tab.displayName = 'Tab'; export default Tab;