import classNames from 'classnames' import { useEffect, useState } from 'react' interface IVSpinnerProps { className?: string /* covers the content area but not the sidebar */ fullPage?: boolean delayDuration?: number } function Spinner() { return ( ) } export default function IVSpinner(props: IVSpinnerProps) { const { className = 'w-8', delayDuration = 0 } = props const [shouldShow, setShouldShow] = useState(delayDuration === 0) useEffect(() => { const to = setTimeout(() => { setShouldShow(true) }, delayDuration) return () => { clearTimeout(to) } }, [delayDuration]) if (!shouldShow) return null if (props.fullPage) { return (
) } return (
) }