import React from "react"; import { FlexWidget, TextWidget, ListWidget, } from "react-native-android-widget"; import dayjs from "dayjs"; import { ToastAndroid } from "react-native"; export const getDelayData = async () => { // Fetch data from the server const time = dayjs().format("HH:mm"); const delayString = await fetch( "https://script.google.com/macros/s/AKfycbyKxch7z7l8e07LXulRHqxjVoIiB13kcgvoToLE-rqlxLmLSKdlmqz0FI1F2EuA7Zfg/exec" ) .then((response) => response.text()) .then((data) => { if (data !== "") { return data.split("^"); } return null; }); ToastAndroid.show(`${delayString}`, ToastAndroid.SHORT); return { time, delayString }; }; export function TraInfoEXWidget({ time, delayString }) { return ( {delayString ? ( delayString.map((d) => { let data = d.split(" "); return ( ); }) ) : ( )} ); } const FlexText = ({ flex, text }) => ( );