Files
gridpilot.gg/apps/website/hooks/onboarding/useGenerateAvatars.ts
2026-01-14 23:46:04 +01:00

33 lines
1.1 KiB
TypeScript

'use client';
import { useMutation, UseMutationOptions } from '@tanstack/react-query';
import { OnboardingService } from '@/lib/services/onboarding/OnboardingService';
import { Result } from '@/lib/contracts/Result';
import { DomainError } from '@/lib/contracts/services/Service';
interface GenerateAvatarsParams {
userId: string;
facePhotoData: string;
suitColor: string;
}
interface GenerateAvatarsResult {
success: boolean;
avatarUrls?: string[];
errorMessage?: string;
}
export function useGenerateAvatars(
options?: Omit<UseMutationOptions<Result<GenerateAvatarsResult, DomainError>, Error, GenerateAvatarsParams>, 'mutationFn'>
) {
return useMutation<Result<GenerateAvatarsResult, DomainError>, Error, GenerateAvatarsParams>({
mutationFn: async (params) => {
const service = new OnboardingService();
// This method doesn't exist in the service yet, but the hook is now created
// The service will need to implement this or we need to adjust the architecture
return Result.ok({ success: false, errorMessage: 'Not implemented' });
},
...options,
});
}