import React, {useState} from "react"; import { CircularInput, CircularTrack, CircularProgress, CircularThumb, useCircularInputContext, } from 'react-circular-input' // Example of a custom component to display text on top of the thumb function TemperatureDisplay() { const {getPointFromValue, value} = useCircularInputContext(); const {x, y} = getPointFromValue(); const style = { fontFamily: "Lato", fontSize: "1.2rem", color: "white", }; return ( {Math.round(value * 100)} ) } export default function Sensor(props) { const style = {width: "10rem", height: "10rem", position: "absolute", top: "0", left: "0"}; const valueStyle = { fill: "#3e99ff", fontSize: "2.5rem", fontFamily: "Lato", textShadow: "1px 1px 0.5px rgba(0, 0, 0, .2)", } const nameStyle = { fill: "#3e99ff", fontSize: "1.5rem", fontFamily: "Lato", textShadow: "1px 1px 0.5px rgba(0, 0, 0, .2)", } const [value, setValue] = useState(0.25); return ( {Math.round(value * props.device.maxValue)}{props.device.units} {props.device.name} ) }