import React, { useContext } from 'react'; import { Box, Link } from '../../primitives'; import Text from '../../primitives/Button/styled-components/Text'; import { LayoutContext } from '../Layout/LayoutContext'; export const Hoverable = ({ href, heading, subHeading }: any) => { const [isHovered, setIsHovered] = React.useState(false); const { Link: NextLink } = useContext(LayoutContext); const LinkComponent = NextLink ?? Link; return ( setIsHovered(true)} onMouseOut={() => setIsHovered(false)} > setIsHovered(true)} onMouseOut={() => setIsHovered(false)} sx={{ color: '$textLight900', _dark: { color: '$textDark50', }, }} > {heading} setIsHovered(true)} onMouseOut={() => setIsHovered(false)} sx={{ color: '$textLight900', _dark: { color: '$textDark50', }, }} > {subHeading} ); };