import * as api from "../service/TransactionService";
import { useQuery } from "@tanstack/react-query";

export const useGetTransactions = (page: number) => {
  return useQuery({
    queryKey: ["transactions", page],
    queryFn: () => api.getTransactions(page),
  });
};

export const useGetTransactionDetail = (id: string, enabled: boolean) => {
  return useQuery({
    queryKey: ["transactions-detail", id],
    queryFn: () => api.getTransactionDetail(id),
    enabled: enabled,
  });
};
