import { useQuery } from '@tanstack/react-query'
import { api } from '../api'
import { User } from '../../types/services/user'


export function useUsers() {
  return useQuery<User[]>({
    queryKey: ['users'],
    queryFn: async () => {
      const res = await api.get('/users')
      return res.data
    },
  })
}
