<commit_before>import {
  BottomSheetModal,
  BottomSheetModalProvider,
  BottomSheetScrollView,
} from "@gorhom/bottom-sheet"
import { NavigationProp, RouteProp, useNavigation, useRoute } from "@react-navigation/native"
import { ReactElement, useCallback, useMemo, useRef } from "react"
import { Dimensions } from "react-native"
import { HomeTabsScreens } from "app/navigation/HomeTabsNavigationStack"
import { Header, ScrollableScreenEntity, ScrollableScreensView } from "app/sharedUI"
import { GlobalStore } from "app/store/GlobalStore"
import { SuspenseWrapper } from "app/wrappers"
import {
  CloseIcon,
  Text,
  Flex,
  MoreIcon,
  Separator,
  Touchable,
  ArtworkIcon,
  ArrowRightIcon,
  EditIcon,
  BriefcaseIcon,
  Spacer,
  useTheme,
} from "palette"
import { ArtworkContent } from "./ArtworkContent/ArtworkContent"
import { EditArtworkInCms } from "./EditArtworkInCms"

type ArtworkRoute = RouteProp<HomeTabsScreens, "Artwork">

export const Artwork = () => {
  const { color } = useTheme()
  const { params } = useRoute<ArtworkRoute>()
  const artworkSlugs = params.contextArtworkSlugs ?? [params.slug]
  const navigation = useNavigation<NavigationProp<HomeTabsScreens>>()

  const screens: ScrollableScreenEntity[] = artworkSlugs.map((slug) => ({
    name: slug,
    content: (
      <SuspenseWrapper key={slug}>
        <ArtworkContent slug={slug} />
      </SuspenseWrapper>
    ),
  }))

  const bottomSheetModalRef = useRef<BottomSheetModal>(null)

  const height = Dimensions.get("window").height

  const snapPoints = useMemo(() => [height > 800 ? "65%" : "75%"], [])

  const handlePresentModalPress = useCallback(() => {
    bottomSheetModalRef.current?.present()
  }, [])

  const handleSheetChanges = useCallback((index: number) => {}, [])

  const isEditArtworkHidden = GlobalStore.useAppState(
    (state) => state.presentationMode.hiddenItems.editArtwork
  )

  return (
    <BottomSheetModalProvider>
      <Header
        safeAreaInsets
        rightElements={
          <Touchable onPress={handlePresentModalPress}><commit_msg>fix: bigger tap area on the more icon (#214)<commit_after>import {
  BottomSheetModal,
  BottomSheetModalProvider,
  BottomSheetScrollView,
} from "@gorhom/bottom-sheet"
import { NavigationProp, RouteProp, useNavigation, useRoute } from "@react-navigation/native"
import { ReactElement, useCallback, useMemo, useRef } from "react"
import { Dimensions } from "react-native"
import { HomeTabsScreens } from "app/navigation/HomeTabsNavigationStack"
import { Header, ScrollableScreenEntity, ScrollableScreensView } from "app/sharedUI"
import { GlobalStore } from "app/store/GlobalStore"
import { SuspenseWrapper } from "app/wrappers"
import {
  CloseIcon,
  Text,
  Flex,
  MoreIcon,
  Separator,
  Touchable,
  ArtworkIcon,
  ArrowRightIcon,
  EditIcon,
  BriefcaseIcon,
  Spacer,
  useTheme,
} from "palette"
import { ArtworkContent } from "./ArtworkContent/ArtworkContent"
import { EditArtworkInCms } from "./EditArtworkInCms"

type ArtworkRoute = RouteProp<HomeTabsScreens, "Artwork">

export const Artwork = () => {
  const { color } = useTheme()
  const { params } = useRoute<ArtworkRoute>()
  const artworkSlugs = params.contextArtworkSlugs ?? [params.slug]
  const navigation = useNavigation<NavigationProp<HomeTabsScreens>>()

  const screens: ScrollableScreenEntity[] = artworkSlugs.map((slug) => ({
    name: slug,
    content: (
      <SuspenseWrapper key={slug}>
        <ArtworkContent slug={slug} />
      </SuspenseWrapper>
    ),
  }))

  const bottomSheetModalRef = useRef<BottomSheetModal>(null)

  const height = Dimensions.get("window").height

  const snapPoints = useMemo(() => [height > 800 ? "65%" : "75%"], [])

  const handlePresentModalPress = useCallback(() => {
    bottomSheetModalRef.current?.present()
  }, [])

  const handleSheetChanges = useCallback((index: number) => {}, [])

  const isEditArtworkHidden = GlobalStore.useAppState(
    (state) => state.presentationMode.hiddenItems.editArtwork
  )

  return (
    <BottomSheetModalProvider>
      <Header
        safeAreaInsets
        rightElements={
          <Touchable
            onPress={handlePresentModalPress}
            hitSlop={{ top: 10, left: 10, right: 10, bottom: 10 }}
          >
{'fraction_non_alphanumeric': 0.11983958480773767, 'fraction_numerical': 0.005897617362585515, 'mean_word_length': 4.367088607594937, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, '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': '123968', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1284, 'n_words': 276}