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