// withHooks 
// noPage
import _global from 'esoftplay/_global';
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
import useGlobalState from 'esoftplay/global';
import React, { useRef } from 'react';

export interface EventSlidingupProps {

}



const state = useGlobalState(undefined)

export function add(view: any): void {
  state.set(view)
}

export function show() {
  _global.event_slidingup_ref?.current?.show?.()
}

export function hide(): void {
  _global.event_slidingup_ref?.current?.hide?.()
}

export default function m(props: EventSlidingupProps): any {
  _global.event_slidingup_ref = useRef<LibSlidingup>(null)
  const view = state.useSelector((s) => s)

  return (
    <LibSlidingup ref={_global.event_slidingup_ref} >
      {view}
    </LibSlidingup>
  )
}