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

27 lines
572 B
TypeScript
Raw Normal View History

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