// withHooks


import useSafeState from 'esoftplay/state';
import React from 'react';
import { View } from 'react-native';


export interface MarketProduct_detail_containerProps {
  children?: any,
  contentHeight?: number
}
export default function m(props: MarketProduct_detail_containerProps): any {
  const [layoutHeight, setLayoutHeight] = useSafeState(0)
  const [offset, setOffset] = useSafeState(0)

  const [isTop, setIsStop] = useSafeState(0)
  const [isBottom, setIsBottom] = useSafeState(0)

  function isCloseToBottom({ layoutMeasurement, contentOffset, contentSize }: any) {
    return layoutMeasurement.height + contentOffset.y >= contentSize.height - 20;
  }



  function isCloseToTop({ layoutMeasurement, contentOffset, contentSize }: any) {
    return contentOffset.y == 0;
  }


  return (
    <View style={{ marginTop: 0 /* LibStyle.STATUSBAR_HEIGHT + 90*/, flex: 1 }}>
      {/* {!!isTop && <LibTextstyle textStyle="footnote" text="TOOOOOOOOOP" />} */}
      {/* <ScrollView
        scrollEventThrottle={1000}
         onScroll={({ nativeEvent }) => {
           setIsStop(0)
           setIsBottom(0)
           if (isCloseToTop(nativeEvent)) {
             setIsStop(1)
             return
           }
           if (isCloseToBottom(nativeEvent)) {
             setIsBottom(1)
             return
           }
         }}
        contentContainerStyle={{ flexGrow: 1 }} >
        {props.children}
        </ScrollView>
      {!!isBottom && <LibTextstyle textStyle="footnote" text="BOTTTTTTOOOOOOOM" />} */}
      {props.children}
    </View>
  )
}