diff --git a/src/main/kotlin/main/Compare.kt b/src/main/kotlin/main/Compare.kt index cd23238..7d46dae 100644 --- a/src/main/kotlin/main/Compare.kt +++ b/src/main/kotlin/main/Compare.kt @@ -65,7 +65,12 @@ fun commonWordsTable( commonWordsHeaderRow() } items(glossaryWords) { word -> - commonWordsDataRow(word, codeWords, glossaryWordsSet) + commonWordsDataRow(word.name, codeWords, glossaryWordsSet) + } + items(codeWords) { word -> + if (word !in glossaryWordsSet) { + commonWordsDataRow(word, codeWords, glossaryWordsSet) + } } } ) @@ -93,7 +98,7 @@ fun commonWordsHeaderRow() { @Composable fun commonWordsDataRow( - word: Word, + word: String, codeWords: List, glossaryWordsSet: Set ) { @@ -102,12 +107,12 @@ fun commonWordsDataRow( .border(1.dp, Color.Black) .padding(8.dp) - val isCommon = word.name in codeWords && word.name in glossaryWordsSet + val isCommon = word in codeWords && word in glossaryWordsSet val backgroundColor = when { isCommon -> Color.Yellow - word.name in codeWords -> Color.Blue // Couleur pour les mots du code - word.name in glossaryWordsSet -> Color.Green // Couleur pour les mots du glossaire + word in codeWords -> Color.Blue // Couleur pour les mots du code + word in glossaryWordsSet -> Color.Green // Couleur pour les mots du glossaire else -> Color.White } @@ -115,8 +120,8 @@ fun commonWordsDataRow( modifier = modifier.background(backgroundColor), verticalAlignment = Alignment.CenterVertically ) { - cellContent(word.name, modifier) - cellContent(if (word.name in codeWords) "Oui" else "Non", modifier) + cellContent(word, modifier) + cellContent(if (word in codeWords) "Oui" else "Non", modifier) cellContent(if (isCommon) "Oui" else "Non", modifier) } }