import { useAtomValue } from 'jotai'; import { FC, useMemo } from 'react'; import { BleState } from '../../context/EstimContext'; import IconBluetooth from '../../icons/IconBluetooth'; const BleStates: FC = () => { const ble = useAtomValue(BleState); const bleIcon = useMemo(() => { if (ble.ready && !ble.searching && !ble.connected) { return 'material-symbols-light:bluetooth'; } else if (ble.ready && ble.searching) { return 'material-symbols-light:bluetooth-searching'; } else if (ble.ready && !ble.searching && ble.connected) { return 'material-symbols-light:bluetooth-connected'; } else { return 'material-symbols-light:bluetooth-disabled'; } }, [ble]); return ( 0} /> ); }; export default BleStates;