Skip to content

Commit

Permalink
add fragmentService and wordService
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Aug 2, 2024
1 parent 850fa87 commit 9f1be2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/fragmentarium/ui/fragment/CuneiformFragmentEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ function AnnotationContents(props: TabsProps): JSX.Element {
<div className="annotation-tool__wrapper">
<TokenAnnotationTool
fragment={props.fragment}
fragmentService={props.fragmentService}
wordService={props.wordService}
onSave={updateFragmentAnnotation}
/>
</div>
Expand Down
21 changes: 19 additions & 2 deletions src/fragmentarium/ui/fragment/TokenAnnotationTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import { lineComponents } from 'transliteration/ui/TransliterationLines'
import { AnnotationLine } from 'transliteration/ui/annotation-line-tokens'
import './TokenAnnotationTool.sass'
import { Table } from 'react-bootstrap'
import FragmentService from 'fragmentarium/application/FragmentService'
import WordService from 'dictionary/application/WordService'

type Props = {
fragment: Fragment
onSave(fragment: Fragment): void
fragmentService: FragmentService
wordService: WordService
}

export default class TokenAnnotationTool extends Component<Props> {
export default class TokenAnnotationTool extends Component<Props, unknown> {
readonly fragment: Fragment

constructor(props: Props) {
Expand All @@ -25,11 +29,22 @@ export default class TokenAnnotationTool extends Component<Props> {
displayMarkableLine({
line,
lineIndex,
fragmentService,
wordService,
}: {
line: TextLine
lineIndex: number
fragmentService: FragmentService
wordService: WordService
}): JSX.Element {
return <AnnotationLine line={line} lineIndex={lineIndex} />
return (
<AnnotationLine
line={line}
lineIndex={lineIndex}
fragmentService={fragmentService}
wordService={wordService}
/>
)
}

render(): JSX.Element {
Expand All @@ -52,6 +67,8 @@ export default class TokenAnnotationTool extends Component<Props> {
key={index}
line={line}
lineIndex={index}
fragmentService={this.props.fragmentService}
wordService={this.props.wordService}
/>
<tr className="line-separator"></tr>
</>
Expand Down

0 comments on commit 9f1be2e

Please sign in to comment.