import {createApp} from 'vue';
import DashboardRepoList from '../components/DashboardRepoList.vue';
import {initRepoMilestoneListSSE} from './repo-milestone-sse.ts';

export function initDashboardRepoList() {
  const el = document.querySelector('#dashboard-repo-list');
  if (el) {
    createApp(DashboardRepoList).mount(el);
  }
  // The dashboard milestones page lists milestones across many repos;
  // subscribe to live progress for each. subscribeRepos is guarded so
  // this is a no-op if repo-legacy already wired it on the same page.
  if (document.querySelector('.page-content.dashboard.milestones li.milestone-card[data-repo-id]')) {
    initRepoMilestoneListSSE();
  }
}
