import React, { PropsWithChildren } from 'react'; import { useGetServerVersionQuery } from '../../app/services/server'; import { compareVersion } from '../utils'; type Props = { version: string, } const ServerVersionChecker = ({ version, children }: PropsWithChildren) => { const { data: currentVersion, isSuccess } = useGetServerVersionQuery(); if (!isSuccess) return null; const res = compareVersion(currentVersion, version); if (res < 0) return
🚨 Server version:{version} needed at least, your current version:{currentVersion}, please upgrade the Server! How to Update VoceChat Server
; return children; }; export default ServerVersionChecker;