import { <%= classify(name) %>PageState } from './<%= dasherize(name) %>.interface';
import { useStateStore } from '~/framework/aop/hooks/use-base-store';
import React, { useContext, useEffect, useCallback, useRef } from 'react';
import { GlobalContext } from '../../context/global/global.provider';
import { Text} from 'react-native'

export function use<%= classify(name) %>Store() {
    const { state, setStateWrap } = useStateStore(new <%= classify(name) %>PageState());
    const { gState } = useContext(GlobalContext);
    const toastRef = useRef({})
      
    function handleActionModal(data: boolean, type: number) {
      switch(type) {
        case ACTION_TYPE.MODAL: 
        setStateWrap({
          modalVisible: data
        })
        break;
        case ACTION_TYPE.TOAST: 
        showToast()
        break;
       default:
         break;
      }
    }  

    function showToast() {
      const { current} = toastRef as any
      current.show(<Text> helllo</Text>, 300)
    }

    return { state, handleActionModal, toastRef }
}