const action = browser.action ?? browser.browserAction; export const renderCount = (count: number): void => { action.setBadgeText({ text: count === 0 ? "" : count > 99 ? "99+" : String(count), }); action.setBadgeBackgroundColor({ color: "#22c55e" }); action.setTitle({ title: count ? `${count} unread notification${count > 1 ? "s" : ""}` : "Tug", }); }; export const renderError = (): void => { action.setBadgeText({ text: "!" }); action.setBadgeBackgroundColor({ color: "#ef4444" }); action.setTitle({ title: "Error fetching notifications" }); };