import React from 'react'; import { useAppUpdates } from '../../../hooks/useAppUpdates'; import { useServerContext } from '../../../context/ServerContext/useServerContext'; import { usePluginContext } from '../../../context/PluginContext/usePluginContext'; import './Header.css'; interface HeaderProps { appVersion?: string; } export const Header: React.FC = ({ appVersion = '1.0.0' }) => { const { isCheckingAppUpdate, appUpdateAvailable, checkForAppUpdate } = useAppUpdates(); const { serverPath } = useServerContext(); const { isCheckingUpdates } = usePluginContext(); const handleCheckForUpdates = async () => { if (!isCheckingAppUpdate) { await checkForAppUpdate(); } }; return (

PlugSnatcher

v{appVersion} {appUpdateAvailable && ( Update Available )}
{serverPath && (
Selected Server: {serverPath.length > 40 ? `...${serverPath.slice(-40)}` : serverPath}
)}
); }; export default Header;