import { useAppDispatch, useAppSelector } from "./useStore"
import { AuthPayload, login, logout } from "@/utils/features/auth/authSlice"

export const useAuth = () => useAppSelector((state) => state.auth)
export const useAuthLogin = () => {
  const dispath = useAppDispatch()
  return (payload: AuthPayload) => dispath(login(payload))
}
export const useAuthLogout = () => {
    const dispatch = useAppDispatch()
    return () => dispatch(logout())
}