import {
  useGetMyAnimeListMangaDataById,
  useSearchMyAnimeListMangaDataByTitle,
} from "@/api/generated/catalog-proxy/catalog-proxy.ts"
import { CatalogSearchInput } from "./CatalogSearchInput"

interface MalSearchInputProps {
  onChange: (id: number | undefined) => void
  disabled?: boolean
}

export const MalInput = ({ onChange, disabled }: MalSearchInputProps) => (
  <CatalogSearchInput
    onChange={onChange}
    disabled={disabled}
    useGetById={useGetMyAnimeListMangaDataById}
    useSearchByTitle={useSearchMyAnimeListMangaDataByTitle}
    idLabel="MAL ID"
    placeholder="Search by title or enter MAL ID..."
  />
)
