'use server';
import { resolve } from '../../lib/server-container.js';
export async function registerUser(input) {
    try {
        const useCase = resolve('RegisterUserUseCase');
        const result = await useCase.execute(input);
        if (!result.ok)
            return { error: result.error };
        return { user: result.user };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to register user';
        return { error: message };
    }
}
