import { useQuery } from '@tanstack/react-query'
import { listRoles } from '../api/listRoles'

export const rolesQueryKey = ['roles'] as const

export function useRoles() {
  return useQuery({
    queryKey: rolesQueryKey,
    queryFn: listRoles,
    staleTime: 30_000,
  })
}
