diff --git a/components/発車時刻表/EachData.tsx b/components/発車時刻表/EachData.tsx index af37d73..9f49e87 100644 --- a/components/発車時刻表/EachData.tsx +++ b/components/発車時刻表/EachData.tsx @@ -92,6 +92,22 @@ export const EachData: FC = (props) => { .split("~")[currentTrainData?.Direction == 1 ? 1 : 0] }間を走行中` : `現在地:${currentTrainData?.Pos}`; + +const [platformNumber, setPlatformNumber] = useState(); +useEffect(()=>{ + fetch("https://n8n.haruk.in/webhook/JR-shikoku-PosID?num="+currentTrainData?.PosNum) + .then(res=>res.json()) + .then(data=>{ + if(data?.type == "Station"){ + setPlatformNumber(data?.platform); + } + else{ + setPlatformNumber(undefined); + } + }) +},[currentTrainData,currentTrain]) + + return ( <> = (props) => { { Linking.openURL( "https://nexcloud.haruk.in/apps/forms/s/TEkBQW5WLcYjLyAzGxncQLtw"