import { useQuery } from '@tanstack/react-query';
import { apiClient } from '../lib/apiClient';
import type { TeamMember } from '../types';

export function useTeamMembers() {
  return useQuery({
    queryKey: ['team-members'],
    queryFn: async () => {
      const { data } = await apiClient.get<TeamMember[]>('/team-members');
      return data;
    },
    staleTime: 60_000,
  });
}
