import React from "react"; import { View, Text, TouchableOpacity, ScrollView, StyleProp, ViewStyle, } from "react-native"; import { Ionicons } from "@expo/vector-icons"; import { SheetManager } from "react-native-actions-sheet"; import LottieView from "lottie-react-native"; import { useTrainDelayData } from "@/stateBox/useTrainDelayData"; import dayjs from "dayjs"; export const JRSTraInfoBox = () => { const { getTime, delayData, loadingDelayData, setLoadingDelayData } = useTrainDelayData(); const styles: { [key: string]: StyleProp } = { touch: { backgroundColor: "#0099CC", borderRadius: 5, margin: 10, borderColor: "black", borderWidth: 2, overflow: "hidden", }, scroll: { backgroundColor: "#0099CC", borderRadius: 5, maxHeight: 300, }, bottom: { position: "absolute", top: 250, alignItems: "center", width: "100%", height: 50, backgroundColor: "#007FCC88", }, box: { padding: 10, backgroundColor: "white", borderBottomLeftRadius: 5, borderBottomRightRadius: 5, }, }; return ( SheetManager.show("JRSTraInfo")} style={styles.touch} > 列車遅延速報EX {getTime ? dayjs(getTime).format("HH:mm") : NaN} setLoadingDelayData(true)} /> {loadingDelayData ? ( ) : delayData ? ( delayData.map((d, index, array) => { let data = d.split(" "); return ( {data[0].replace("\n", "")} {data[1]} {data[3]} ); }) ) : ( 現在、5分以上の遅れはありません。 )} 詳細を見る ); };