Skip to content

Instantly share code, notes, and snippets.

@tiagoefmoraes
Created October 17, 2019 18:01
Show Gist options
  • Save tiagoefmoraes/f455ed54064e99be3664c77632a85800 to your computer and use it in GitHub Desktop.
Save tiagoefmoraes/f455ed54064e99be3664c77632a85800 to your computer and use it in GitHub Desktop.
NFe*
NFe*
Pendente*
transmitir -> Aguardando Autorização
Aguardando Autorização
autorizada -> Autorizada
erro -> Erro
volta -> Pendente
Autorizada
Erro
function render(model){
console.log(model)
function addImage() {
if (model.active_states[0].image_url) {
return $("img",
{src: model.active_states[0].image_url, style: {heightx: "70%", margin: "0 auto"}})
} else {
return "No image available."
}
}
let current_state_name = model.active_states[0].name;
return (
<div style={{textAlign: "center"}}>
<h1 style={{color: "darkBlue"}}>{current_state_name}</h1>
<div style={{backgroundColor: "lightBlue"}}
onMouseEnter={() => {model.emit("transmitir")}}
onMouseLeave={() => {model.emit("volta")}}
>Nfe {current_state_name}</div>
{addImage()}
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment