// GlossTip is the inline hover gloss: rest the pointer on an English word and a // small bubble shows its Chinese meaning, pulled instantly from the offline // gloss dataset. It's a pure reading aid β€” pointer-events are off so it never // steals hover or blocks a click, and it sits just under the word. Bilingual // chrome elsewhere puts zh first; here the gloss IS the content (the word is // already on screen), so the bubble shows only the δΈ­ζ–‡. interface Props { gloss: string // The English meaning of the same token read as a word of the writer's own // language, when it is one. On a Latin-script pair "sale" is both, and the // bubble shows the two readings stacked rather than picking one β€” the same // both-directions rule the word card follows, in one line less space. reverse?: string // How the writer's language names itself, to label the second line. reverseLang?: string style: React.CSSProperties } export function GlossTip({ gloss, reverse, reverseLang, style }: Props) { return (
{gloss} {reverse && ( {reverseLang ? `${reverseLang}: ` : ''} {reverse} )}
) }