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

export const useTalkJS = () => {
  const { data: talkJs, isLoading } = useQuery({
    queryKey: ['talk-js'],
    queryFn: () =>
      fetch('/admin/talk-js')
        .then((res) => res.json())
        .catch((err) => {
          message: err
        })
  })

  return { ...talkJs, isLoading }
}
