import { Runtime } from '../runtime/runtime.js';

Runtime.bus.on('open-project', ({ id }) => {

    console.log('OPEN', id);

    // router navigate
});

Runtime.bus.on('edit-project', ({ id }) => {

    console.log('EDIT', id);

    openProjectEditModal(id);
});

Runtime.bus.on('archive-project', async ({ id }) => {

    console.log('ARCHIVE', id);

    await fetch(`/api/projects/${id}/archive`, {
        method: 'POST'
    });

    Runtime.bus.emit('project-updated');
});
