import { composePoetryURL, initialPoetry, processPoetry } from '../../api/poetry'
import { Poetry, isPoetryResponse } from '../../api/poetry/types'
import useFetch, { UseFetchReturn } from '../useFetch'

const usePoetry = (): UseFetchReturn<Poetry> => (
    useFetch(
        composePoetryURL(),
        'GET',
        false,
        isPoetryResponse,
        processPoetry,
        initialPoetry,
    )
)


export default usePoetry
