<commit_before>import { RouteProp, useRoute } from "@react-navigation/native"
import { HomeTabsScreens } from "app/navigation/HomeTabsNavigationStack"
import { Header } from "app/sharedUI"
import { Flex } from "palette"
import { WebView } from "react-native-webview"

type ArtworkWebViewRoute = RouteProp<HomeTabsScreens, "ArtworkWebView">

export const ArtworkWebView = () => {
  const { uri } = useRoute<ArtworkWebViewRoute>().params

  return (
    <Flex flex={1} pb={2}>
      <Header safeAreaInsets />
      <WebView source={{ uri }} />
    </Flex>
  )
}
<commit_msg>feat(MOPLAT-397): Add progress bar to CMS web view (#149)<commit_after>import { RouteProp, useRoute } from "@react-navigation/native"
import { HomeTabsScreens } from "app/navigation/HomeTabsNavigationStack"
import { Header } from "app/sharedUI"
import { Flex, ProgressBar } from "palette"
import { useState } from "react"
import { WebView } from "react-native-webview"

type ArtworkWebViewRoute = RouteProp<HomeTabsScreens, "ArtworkWebView">

export const ArtworkWebView = () => {
  const { uri } = useRoute<ArtworkWebViewRoute>().params
  const [loadProgress, setLoadProgress] = useState<number>(0)
  const [isProgressBarVisible, setIsProgressBarVisible] = useState(true)

  return (
    <Flex flex={1} pb={2}>
      <Header safeAreaInsets />
      <WebView
        source={{ uri }}
        onLoadProgress={(e) => setLoadProgress(e.nativeEvent.progress)}
        onLoad={() => setIsProgressBarVisible(false)}
      />
      {isProgressBarVisible && (
        <Flex px={4} height="100%" justifyContent="center">
          <ProgressBar progress={loadProgress} />
        </Flex>
      )}
    </Flex>
  )
}

{'fraction_non_alphanumeric': 0.13536076326774002, 'fraction_numerical': 0.008944543828264758, 'mean_word_length': 4.069486404833837, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2762396', 'n_tokens_mistral': 541, 'n_tokens_neox': 524, 'n_words': 115}