import { useQuery } from 'react-query'
import { GetProductSimilarProps, getProductSimilar } from '~/services/product'

type Props = GetProductSimilarProps

const useProductSimilar = (props: Props) => {
  const similarQuery = useQuery({
    queryKey: ['product-similar', props],
    queryFn: () => getProductSimilar(props),
  })

  return similarQuery
}

export default useProductSimilar