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/AKfycbw-0RDLAu8EQAEWA860tk4KVW6VOr3iIU900AcWEfqIP16gtNUG1XO_A3oBfAGiNeCf/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 }) => ( );