Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
Something went wrong. Try again.
525 B · 31 lines
TSX
at v0
1234567891011121314151617181920212223242526272829303132import React, { useState } from 'react'
const STATUS = { HOVERED: 'hovered', NORMAL: 'normal',}
function Link({ page, children }: any) { const [status, setStatus] = useState(STATUS.NORMAL)
const onMouseEnter = () => { setStatus(STATUS.HOVERED) }
const onMouseLeave = () => { setStatus(STATUS.NORMAL) }
return ( <a className={status} href={page || '#'} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} > {children} </a> )}
export default Link