({
duration,
children,
}: {
duration: number
children: React.ReactNode
})
| 23 | } |
| 24 | |
| 25 | export function Blink({ |
| 26 | duration, |
| 27 | children, |
| 28 | }: { |
| 29 | duration: number |
| 30 | children: React.ReactNode |
| 31 | }) { |
| 32 | const [shouldShow, setShouldShow] = React.useState<boolean>(true) |
| 33 | |
| 34 | React.useEffect(() => { |
| 35 | setShouldShow(true) |
| 36 | const timeout = setActTimeout(() => setShouldShow(false), duration) |
| 37 | return () => { |
| 38 | clearTimeout(timeout) |
| 39 | } |
| 40 | }, [duration, children]) |
| 41 | |
| 42 | return shouldShow ? <>{children}</> : <>off</> |
| 43 | } |
| 44 | |
| 45 | export function mockOnlineManagerIsOnline( |
| 46 | value: boolean, |
nothing calls this directly
no test coverage detected
searching dependent graphs…