import { useQuery } from 'react-query'; import { getVersionStatus } from '@/portainer/services/api/status.service'; import styles from './UpdateNotifications.module.css'; export function UpdateNotification() { const query = useUpdateNotification(); if (!query.data || !query.data.UpdateAvailable) { return null; } const { LatestVersion } = query.data; return (
A new version is available
); } function useUpdateNotification() { return useQuery(['status', 'version'], () => getVersionStatus()); }