import { useQuery } from '@tanstack/react-query';
import { memberApi } from '@/api';

/**
 * 멤버 목록 조회 훅
 */
export function useMembers() {
  return useQuery({
    queryKey: ['members'],
    queryFn: memberApi.getMembers,
  });
}

/**
 * 멤버 상세 조회 훅
 * @param {number} id - 멤버 ID
 */
export function useMemberDetail(id) {
  return useQuery({
    queryKey: ['member', id],
    queryFn: () => memberApi.getMemberById(id),
    enabled: !!id,
  });
}
