Skip to content

Commit

Permalink
tweak chapter name display
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Sep 26, 2023
1 parent 6165f6c commit 1afef71
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/fragmentarium/ui/ngram-matching/NgramMatching.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import { HeadTags } from 'router/head'
import FragmentService from 'fragmentarium/application/FragmentService'
import { NgramScore } from 'fragmentarium/domain/ngramMatching'
import { Col, Container, Row } from 'react-bootstrap'
import { GenreInfoRow } from 'corpus/ui/search/CorpusSearchResult'
import { chapterIdToString } from 'transliteration/domain/chapter-id'
import _ from 'lodash'
import { Markdown } from 'common/Markdown'
import { genreFromAbbr } from 'corpus/ui/Corpus'

function NgramMatchingHeadTags({ number }: { number: string }): JSX.Element {
return (
Expand Down Expand Up @@ -46,12 +48,15 @@ function NgramMatching({
{ngramScores.map((score, index) => (
<Row key={index}>
<Col>
{
<GenreInfoRow
chapterId={_.omit(score, 'overlap', 'textName')}
textName={score.textName}
/>
}
<Markdown text={genreFromAbbr(score.textId.genre)} />
{score.textName && (
<>
{' > '}
<Markdown text={score.textName} />
</>
)}
{' > '}
{chapterIdToString(_.omit(score, 'score', 'textName'))}
</Col>
<Col>{score.score.toFixed(4)}</Col>
</Row>
Expand Down

0 comments on commit 1afef71

Please sign in to comment.