'use client'

import { useMutation } from '@tanstack/react-query'
import { apiClient } from '../client'
import type { MailAccountDiscoverResult } from '../types'

export function useDiscoverMailAccount() {
  return useMutation({
    mutationFn: (email: string) =>
      apiClient.get<MailAccountDiscoverResult>('/mail/accounts/discover', { email }),
  })
}
