'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { useEffect, useState } from 'react';
import { TimelineView } from './timeline-view.js';
import { listProjectRelations } from '../../../app/actions/list-project-relations.js';
export function TimelineViewWrapper({ projectId, workItems, states, projectPrefix, onItemClick, className, }) {
    const [relations, setRelations] = useState([]);
    useEffect(() => {
        async function load() {
            const result = await listProjectRelations(projectId);
            if (result.relations) {
                setRelations(result.relations);
            }
        }
        load();
    }, [projectId]);
    return (_jsx(TimelineView, { workItems: workItems, states: states, relations: relations, projectPrefix: projectPrefix, onItemClick: onItemClick, className: className }));
}
