UNPKG

zigbee2mqtt-windfront

Version:

[![Version](https://img.shields.io/npm/v/zigbee2mqtt-windfront.svg)](https://npmjs.org/package/zigbee2mqtt-windfront) [![CI](https://github.com/Nerivec/zigbee2mqtt-windfront/actions/workflows/ci.yml/badge.svg)](https://github.com/Nerivec/zigbee2mqtt-windf

2 lines (1 loc) 911 B
import{r as c,b as u,j as n}from"./index-C9teBVht.js";const l=c.memo(r=>{const{value:a,name:s}=r,{t}=u("values");switch(s){case"contact":return t(a?e=>e.closed:e=>e.open);case"occupancy":return t(a?e=>e.occupied:e=>e.clear);case"water_leak":return a?n.jsx("span",{className:"text-error animate-pulse",children:t(e=>e.leaking)}):t(e=>e.clear);case"tamper":return a?n.jsx("span",{className:"text-error animate-pulse",children:t(e=>e.tampered)}):t(e=>e.clear);case"supported":return t(a?e=>e.supported:e=>e.not_supported);default:return t(a?e=>e.true:e=>e.false)}}),i=c.memo(r=>{const{t:a}=u("values"),{value:s}=r;switch(typeof s){case"boolean":return n.jsx(l,{...r});case"undefined":return"N/A";case"object":return s===null?a(t=>t.null):JSON.stringify(s);case"string":return s===""?n.jsx("span",{className:"text-xs opacity-50",children:a(t=>t.empty_string)}):s;default:return JSON.stringify(s)}});export{i as D};