import type { VoiceSplitRequest, VoiceSplitResponse } from '@superlist/shared' import { useMutation } from '@tanstack/react-query' import { apiFetch } from '@/lib/api-client' /** * Asks the API to split a dictated sentence into one string per item, each written the * way the item parser reads typed text. The API never fails because of the model (it * falls back to splitting on commas and "y"), so an error here means the request did not * get through. */ export function useVoiceSplit() { return useMutation({ mutationFn: (input: VoiceSplitRequest) => apiFetch('/voice/split', { method: 'POST', body: JSON.stringify(input), }), }) }