import { createContext, useContext } from 'react'
import type { VerifyContextType } from '../types'

const VerifyContext = createContext<VerifyContextType>({
  success: () => {},
  error: () => {}
})

export function VerifyProvider(props: {
  success: (params: any) => void
  children: React.ReactNode
}) {
  return (
    <VerifyContext.Provider value={{ success: props.success }}>
      {props.children}
    </VerifyContext.Provider>
  )
}

export function useVerifyContext() {
  return useContext(VerifyContext)
}
