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
23 lines (22 loc) • 1.31 kB
JavaScript
import React from 'react';
import { Box, Text } from 'ink';
export const ISSTracker = ({ issData }) => {
return (React.createElement(Box, { borderStyle: "round", padding: 2, margin: 1, width: 50 },
React.createElement(Box, { flexDirection: "column" },
React.createElement(Text, { color: "blue" }, "\uD83D\uDEF0\uFE0F ISS LOCATION"),
React.createElement(Text, { color: "white" }, "\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),
issData ? (React.createElement(React.Fragment, null,
React.createElement(Text, { color: "cyan" },
"Latitude:",
' ',
React.createElement(Text, { color: "yellow" },
issData.latitude.toFixed(4),
"\u00B0")),
React.createElement(Text, { color: "cyan" },
"Longitude:",
' ',
React.createElement(Text, { color: "yellow" },
issData.longitude.toFixed(4),
"\u00B0")),
React.createElement(Text, { color: "green" }, "\uD83C\uDF0D Orbiting Earth right now!"))) : (React.createElement(Text, { color: "red" }, "Loading ISS data...")))));
};