This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
scoresaber-reloadedv3/projects/website/src/components/offline-network.tsx
Liam 4eb96da1f1
Some checks failed
Deploy Backend / deploy (push) Has been cancelled
Deploy Website / deploy (push) Successful in 5m32s
add more info to offline network check
2024-10-19 07:52:19 +01:00

27 lines
572 B
TypeScript

"use client";
import FullscreenLoader from "@/components/loaders/fullscreen-loader";
import { useNetworkState } from "@uidotdev/usehooks";
import { ReactNode } from "react";
type Props = {
children: ReactNode;
};
export default function OfflineNetwork({ children }: Props) {
const network = useNetworkState();
return !network.online ? (
<FullscreenLoader
reason={
<>
<p>Your device is offline. Check your internet connection.</p>
<p>Connection Type: {network.type}</p>
</>
}
/>
) : (
children
);
}