import { View, ScrollView, Text as RNText } from "react-native";
import { Button, ToggleButton } from "react-native-paper";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import humanizeDistance from "~/lib/geo/humanizeDistance";
import { useTheme } from "~/theme";
import { profileDefaultModes } from "./routing";
import humanizeDuration from "~/utils/time/humanizeDuration";
import RoutingStep from "./RoutingStep";
import Text from "~/components/Text";
import IconTouchTarget from "~/components/IconTouchTarget";
import { STATE_CALCULATING_LOADED } from "./constants";
import RoutingCalculating from "./RoutingCalculating";
export default function RoutingSteps({
setProfile,
profile,
destinationName,
closeStepper,
instructions,
distance,
duration,
calculatingState,
titleA11yRef,
}) {
const { colors, custom } = useTheme();
const profileDefaultMode = profileDefaultModes[profile];
if (distance === 0) {
instructions = instructions.slice(1);
}
// calculatingState = 2;
return (
<>
Itinéraire
{
return (
);
}}
/>
{
return (
);
}}
/>
{
return (
);
}}
/>
{calculatingState === STATE_CALCULATING_LOADED && (
<>
{destinationName}
{humanizeDistance(distance)}
{", " + humanizeDuration(duration)}
{instructions.map((instruction, index) => {
return (
);
})}
>
)}
{calculatingState !== STATE_CALCULATING_LOADED && (
)}
({
position: "absolute",
top: 4,
right: 0,
backgroundColor: colors.surface,
borderRadius: 8,
opacity: pressed ? 0.7 : 1,
})}
>
>
);
}