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

export function useChargeableCharConfig(id: number) {
  return useQuery({
    queryKey: ['chargeableChars', id] as const,
    queryFn: () => getChargeableCharConfig(id),
    enabled: id > 0,
    staleTime: 30_000,
  })
}
