import { useNavigation } from "expo-router";
import { useLocalSearchParams } from "expo-router/build/hooks";
import WebView from "react-native-webview";

export default function WebScreen() {

    const nav = useNavigation();

    const {uri} = useLocalSearchParams<{uri: string}>();
    return <WebView className="flex-1"
        source={{uri}}
        onNavigationStateChange={(navState) => {
      if (navState.title) {
        nav.setOptions({ title: navState.title });
      }
    }}
    />;
}