import React, { useEffect } from "react"; import { Form, Input, Select } from "antd"; // import { useSearch } from "@umijs/hooks"; import { useErrors } from "../../useErrors"; import { fetchArtistsByName } from "../../api-service"; const REQUIRED = [ { required: true, message: "This filed is required!", }, ]; const ARTISTS_LIMIT = 10; const getArtists = function (value) { return fetchArtistsByName(value, ARTISTS_LIMIT) .then((response) => response.data.value) .catch(this.handleError); }; const AddAlbumForm = () => { const { handleError } = useErrors(); // const { // data: artists, // loading: isArtistsLoading, // onChange: onChangeArtistInput, // cancel: onArtistCancel, // } = useSearch(getArtists.bind({ handleError })); // useEffect(() => { // onChangeArtistInput(); // }, []); return ( <>

Add album

{/* */} ); }; export { AddAlbumForm };