/**
 * twemojiBroken shim — tracks which emoji codepoints Twemoji fails on.
 */

import { useState } from 'react';

const broken: Set<string> = new Set();

export function isTwemojiBroken(codepoint: string): boolean {
	return broken.has(codepoint);
}

export function markTwemojiBroken(codepoint: string): void {
	broken.add(codepoint);
}

export function useBrokenTwemojiVersion(): number {
	const [version] = useState(0);
	return version;
}

export default { isTwemojiBroken, markTwemojiBroken, useBrokenTwemojiVersion };
