import { useMutation } from '@tanstack/react-query'
import { aiService, parseListingText } from '../services/aiService'
import type { OfferEmailPayload } from '../services/aiService'

export function useParseNeed() {
  return useMutation({
    mutationFn: (text: string) => aiService.parseNeed(text),
  })
}

export function useGenerateOfferEmail() {
  return useMutation({
    mutationFn: (payload: OfferEmailPayload) => aiService.generateOfferEmail(payload),
  })
}

export function useGenerateDecisionBrief() {
  return useMutation({
    mutationFn: (shortlistId: string) => aiService.generateDecisionBrief(shortlistId),
  })
}

export function useParseListingText() {
  return useMutation({
    mutationFn: (text: string) => parseListingText(text),
  })
}
