import { FC } from "react";
import { TouchableOpacity, View, Text, Linking } from "react-native";
type Props = {
    navigate: (screen: string, params: { info: string; goTo: string; useShow: boolean }) => void;
    address: string;
    goTo: string;
    useShow: boolean;
    onExit: () => void;
};
export const 駅構内図:FC<Props> = (props) => {
  const { navigate, address, goTo, useShow, onExit } = props;
  const info = address.replace("/index.html", "/") + "/kounai_map.html";
  return (
    <TouchableOpacity
      style={{
        height: 50,
        backgroundColor: "#888A85",
        flexDirection: "column",
        alignContent: "center",
        alignItems: "center",
        margin: 2,
        flex: 1,
      }}
      onPress={() => {
        navigate("howto", { info, goTo, useShow });
        onExit();
      }}
      onLongPress={() => Linking.openURL(info)}
    >
      <View style={{ flex: 1 }} />
      <Text
        style={{
          color: "white",
          textAlign: "center",
          textAlignVertical: "center",
          flex: 1,
        }}
      >
        駅構内図を表示
      </Text>
      <View style={{ flex: 1 }} />
    </TouchableOpacity>
  );
};
