'use server';
import { resolve } from '../../lib/server-container.js';
export async function getModuleProgress(projectId) {
    if (!projectId?.trim()) {
        return { error: 'Project ID is required' };
    }
    try {
        const useCase = resolve('GetModuleProgressUseCase');
        const result = await useCase.execute(projectId);
        if (!result.ok)
            return { error: result.error };
        return { modules: result.modules };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to get module progress';
        return { error: message };
    }
}
