shared(nearby): add layerDisplayName and wire into subtitleFor;

app(found): use shared layerDisplayName for Hittat subtitle (no UI change)
This commit is contained in:
2025-09-13 14:36:54 +02:00
parent 23e237c457
commit 0ed70edb9e
3 changed files with 16 additions and 17 deletions

View File

@@ -4,15 +4,7 @@ import app.klottr.util.FoundStore // För lagerkonstanter (WIKI, DM, FO
import app.klottr.nearby.NearbyEntryShared // Vår delade radmodell
// Bygg undertext: "<Lager-namn> • <avstånd> m"
fun subtitleFor(entry: NearbyEntryShared): String = buildString { //
append(
when (entry.layer) {
FoundStore.LAYER_WIKI -> "Wikipedia"
FoundStore.LAYER_DM -> "DigitaltMuseum"
FoundStore.LAYER_FORNSOK -> "Fornsök"
FoundStore.LAYER_KLOTTER -> "Klotter"
else -> "Plats"
}
)
fun subtitleFor(entry: NearbyEntryShared): String = buildString { //
append(layerDisplayName(entry.layer)) // Använd delad namngivare istället för inline-when
append(" • ${entry.distanceM} m")
}