'use server';
import { resolve } from '../../lib/server-container.js';
export async function deleteWorkItem(workItemId) {
    if (!workItemId?.trim()) {
        return { error: 'Work item ID is required' };
    }
    try {
        const useCase = resolve('DeleteWorkItemUseCase');
        const result = await useCase.execute(workItemId);
        if (!result.ok)
            return { error: result.error };
        return {};
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to delete work item';
        return { error: message };
    }
}
