import { expose, groupTracksPerScheme } from "@scripts/common";
import { CONNECTIONS } from "./constants";
import type { Track } from "@applets/core/types";

////////////////////////////////////////////
// ACTIONS
////////////////////////////////////////////
const actions = expose({
  groupTracks,
});

export type Actions = typeof actions;

// Actions

function groupTracks(tracks: Track[]) {
  return groupTracksPerScheme(
    tracks,
    Object.fromEntries(
      Object.entries(CONNECTIONS).map(([k, _v]) => {
        return [k, []];
      }),
    ),
  );
}
