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

19 lines
436 B
TypeScript
Raw Normal View History

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