import { usePoetry } from '../hooks/api' import { gotError, gotResponse } from '../hooks/useFetch' import styles from '../styles/Poetry.module.css' function Poetry() { const poetry = usePoetry() return (

Поэзия

{ gotResponse(poetry) ? ( gotError(poetry) ? (
Ошибка получения стиха

{poetry.error}

) : ( <>
{poetry.data.title}

{poetry.data.author}

Иллюстрация ) ) : (
Загрузка...
) }
) } export default Poetry