'use client'
import { useSafeQuery } from "@/hooks/use-safe-query";
import { getSurveyByIdAction, getSurveysAction, getSurveysForUserAction } from "../actions/surveys-actions";


// Hook for all survesys 
export function useSurveysQuery(params = {}) {
    return useSafeQuery(['surveys',params], () =>  getSurveysAction(params))
}

export function useSurveysForUserQuery(params = {}) {
    return useSafeQuery(['surveys',params], () =>  getSurveysForUserAction(params))
}



  
export function useSurveysByIdQuery(id: number) {   
    return useSafeQuery(['surveys',id], () =>  getSurveyByIdAction(id))
}