/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ import { ReactReduxContext, useSelector } from "react-redux"; import { getNotificationIdsForUrl, isWebNotificationsEnabled, } from "content-src/lib/web-notification-match.mjs"; import React from "react"; function Badge({ link }) { const enabled = useSelector(isWebNotificationsEnabled); const count = useSelector( state => getNotificationIdsForUrl(state, link?.url).length ); if (!enabled || !count) { return null; } return