Skip to content

Commit

Permalink
Slight refactoring because a func was only used in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
DuncanRitchie committed Aug 14, 2024
1 parent cce3b1d commit 2422563
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions components/lemma/VerbFormsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ import verbStyles from './VerbFormsTable.module.css'
// might become HTML <td className="infinitive active present">clāmāre</td>

const TableForSomeVerbForms = ({ formsFromWordsCollection, Forms, linkBase, currentWordHyphenated }) => {
const generateLatinLinksOrPlainText = (formsArray) => (
<LatinLinksOrPlainText
formsArray={formsArray}
formsFromWordsCollection={formsFromWordsCollection}
linkBase={linkBase}
currentWordHyphenated={currentWordHyphenated}
/>
)
const VerbDataCell = ({ className }) => {
const classesArray = className.split(' ')
let forms = Forms
Expand All @@ -30,7 +22,17 @@ const TableForSomeVerbForms = ({ formsFromWordsCollection, Forms, linkBase, curr
}
forms = forms[key]
})
return <td className={className}>{generateLatinLinksOrPlainText(forms)}</td>

return (
<td className={className}>
<LatinLinksOrPlainText
formsArray={forms}
formsFromWordsCollection={formsFromWordsCollection}
linkBase={linkBase}
currentWordHyphenated={currentWordHyphenated}
/>
</td>
)
}

// Hardly any verbs should have a column for a future active infinitive.
Expand Down

0 comments on commit 2422563

Please sign in to comment.