squiggle/packages/website/src/components/FallbackSpinner.jsx
2022-07-23 22:17:04 +04:00

18 lines
491 B
JavaScript

import { useEffect, useState } from "react";
import { RefreshIcon } from "@heroicons/react/solid";
import styles from "./FallbackSpinner.module.css";
export const FallbackSpinner = ({ height }) => {
const [show, setShow] = useState(/* false */ true);
useEffect(() => {
setTimeout(() => {
setShow(true);
}, 500);
}, []);
return (
<div className={styles.container} style={{ height }}>
{show ? <RefreshIcon className={styles.icon} /> : null}
</div>
);
};