Hello all, I am creating a widget with just the oh-label-card component and as configuration just label and in this label I would like to put some text like this for instance (in french) : Sébastien(props.firstname) à été localisé(e)(depend on props.kind) la dernière fois à 16H(item[props.lastseen].state)
But adding a condition (for props.kind) does not work and gives me the following error message: Nested mappings are not allowed in compact mappings
Do you have any solutions to my problem knowing that I can use other components since I just want text with different props.something and conditions?
Here is my code:
uid: texte_localisation
tags:
- localisation
props:
parameters:
- label: Prénom
name: firstname
required: true
type: TEXT
- description: Tapez FEM si le texte doit être affiché au féminin sinon laissez vide
label: Genre
name: kind
required: false
type: TEXT
advanced: true
- context: item
label: Dernière localisation envoyée
name: lastseen
required: false
type: TEXT
parameterGroups: []
timestamp: Mar 26, 2022, 10:31:49 AM
component: oh-label-card
config:
label: =(props.firstname) + " a été " + props.kind === "FEM" ? "localisée" : "localisé" + "la dernière fois à " + items[props.lastseen].state
Thanks in advance.
S.CASTERMANS