UNPKG

realtime-data-cli-tool

Version:

A real-time data dashboard CLI tool built with Ink, React, and TypeScript that displays live ISS location, weather, Bitcoin prices, random facts, and inspirational quotes

16 lines (15 loc) 1 kB
import React from 'react'; import { Box, Text } from 'ink'; export const BitcoinPrice = ({ bitcoin }) => { return (React.createElement(Box, { borderStyle: "round", padding: 2, margin: 1, width: 50 }, React.createElement(Box, { flexDirection: "column" }, React.createElement(Text, { color: "yellow" }, "\u20BF BITCOIN PRICE"), React.createElement(Text, { color: "white" }, "\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"), bitcoin ? (React.createElement(React.Fragment, null, React.createElement(Text, { color: "yellow" }, "$", bitcoin.price.toLocaleString()), React.createElement(Text, { color: bitcoin.change24h >= 0 ? 'green' : 'red' }, bitcoin.change24h >= 0 ? '📈 +' : '📉 ', bitcoin.change24h.toFixed(2)))) : (React.createElement(Text, { color: "red" }, "Loading Bitcoin data..."))))); };