import { useMutation } from '@tanstack/react-query';
import { profilesApi } from '../apis';

/**
 * Uploads an avatar image and returns its URL. The caller folds the returned URL into the
 * next profile upsert. Backed by the mock until the object-storage route lands (REQ-006).
 */
export function useUploadAvatar() {
  return useMutation({
    mutationFn: (file: File) => profilesApi.uploadAvatar(file),
  });
}
