DictDisplays
Shared presentational components for dictionary data (JMdict / JMnedict entries, kanji profiles, examples, morphology), reused by the WordDialog quick lookup and the Dictionary hub at different levels of interactivity: the hub makes examples, kanji, radicals, and cross-references clickable, while the dialog renders them inert.
Functions¶
DictTabs()¶
Defined in: src/shared/components/DictDisplays.tsx:438
The hub's shared tab bar: an underlined row of section tabs, one active at a time, so each view stays a single compact panel instead of a long scroll.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ active: string; onSelect: (tab) => void; tabs: string[]; } |
The tab labels, the active one, and the callback. |
props.active |
string |
- |
props.onSelect |
(tab) => void |
- |
props.tabs |
string[] |
- |
Returns¶
Element
The tab bar.
EntryBadges()¶
Defined in: src/shared/components/DictDisplays.tsx:32
The badge row shown beside a JMdict entry headword.
Parameters¶
| Parameter | Type |
|---|---|
__namedParameters |
{ entry: JMEntry; } |
__namedParameters.entry |
JMEntry |
Returns¶
Element
ExamplesSection()¶
Defined in: src/shared/components/DictDisplays.tsx:283
Renders example sentences with their English translations. Sentences are
tokenized for furigana; with onWordClick the tokens are clickable (the
hub), in the dialog the handler opens the word's entry in a new tab.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ examples: Example[]; onWordClick: (sentence, word) => void; } |
The examples + a per-word click handler. |
props.examples |
Example[] |
- |
props.onWordClick |
(sentence, word) => void |
- |
Returns¶
Element
The rendered examples.
GrammarSection()¶
Defined in: src/shared/components/DictDisplays.tsx:378
Renders the morphological detail carried by a stitched word's underlying UniDic tokens (reading, part-of-speech hierarchy, conjugation, base form, origin). Japanese grammatical terms carry a tooltip with their English meaning.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ tokens: Token[]; } |
The word's constituent tokens. |
props.tokens |
Token[] |
- |
Returns¶
Element
The grammar breakdown.
JmdictEntryDisplay()¶
Defined in: src/shared/components/DictDisplays.tsx:111
Displays a JMdict entry: written / read forms, common + frequency badges, and its numbered senses.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ entry: JMEntry; isLast: boolean; onRefClick?: (ref) => void; } |
The entry, a last-row flag, and an optional cross-reference click handler. |
props.entry |
JMEntry |
- |
props.isLast |
boolean |
- |
props.onRefClick? |
(ref) => void |
- |
Returns¶
Element
The rendered entry.
JMEntryRow()¶
Defined in: src/shared/components/DictDisplays.tsx:478
A clickable JMdict result row (search result lists).
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ entry: JMEntry; onSelect: (word) => void; } |
The entry + callback. |
props.entry |
JMEntry |
- |
props.onSelect |
(word) => void |
- |
Returns¶
Element
The row.
JmnedictEntryDisplay()¶
Defined in: src/shared/components/DictDisplays.tsx:149
Displays a JMnedict (proper noun) entry with its readable name types.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ entry: JMNEntry; isLast: boolean; } |
The entry + last-row flag. |
props.entry |
JMNEntry |
- |
props.isLast |
boolean |
- |
Returns¶
Element
The rendered entry.
JMNEntryRow()¶
Defined in: src/shared/components/DictDisplays.tsx:504
A clickable JMnedict result row.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ entry: JMNEntry; onSelect: (word) => void; } |
The entry + callback. |
props.entry |
JMNEntry |
- |
props.onSelect |
(word) => void |
- |
Returns¶
Element
The row.
KanjiCard()¶
Defined in: src/shared/components/DictDisplays.tsx:181
Displays one kanji: its stroke-order drawing (or plain glyph) beside stats badges, meanings, readings, and its radical components.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ isLast: boolean; kanji: KanjiInfo; onKanjiClick?: (literal) => void; onRadicalClick?: (radical) => void; } |
The kanji, a last-row flag, and optional handlers that make the glyph / radicals clickable on the hub. |
props.isLast |
boolean |
- |
props.kanji |
KanjiInfo |
- |
props.onKanjiClick? |
(literal) => void |
- |
props.onRadicalClick? |
(radical) => void |
- |
Returns¶
Element
The rendered kanji card.
KanjiRow()¶
Defined in: src/shared/components/DictDisplays.tsx:528
A clickable kanji result row.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
{ kanji: KanjiInfo; onSelect: (word) => void; } |
The kanji + callback. |
props.kanji |
KanjiInfo |
- |
props.onSelect |
(word) => void |
- |
Returns¶
Element
The row.