import { browser } from 'wxt/browser'; export const Header = ({ title, flagCode }: { title: string, flagCode?: string | null }) => { const getFlagUrl = (code?: string | null) => { if (!code) return ''; try { const path = `/${code.toLowerCase()}.webp`; return browser.runtime.getURL(path as any); } catch { return ''; } }; return (

{title}

{flagCode && ( {flagCode} (e.currentTarget.style.display = 'none')} /> )}
); };