import { useMutation } from '@tanstack/react-query'
import { signup } from '@/lib/api/auth/signup'
import { useAuthStore } from '@/zustand/authStore'

export const useSignup = () =>
    useMutation({
        mutationFn: signup,
        onSuccess: (data) => {
            useAuthStore.getState().login(data)
        },
    })
