import { reactive, ref } from "vue";

export function createReleaseStore() {
  const releases = ref<any>(null);
  const notices = ref<any[]>([]);
  const selectedNotice = ref<any | null>(null);
  const noticeDraft = reactive({ version: "", raw: "", note: "", preview: null as any });
  const uploadDraft = reactive({
    file: null as File | null,
    version: "",
    platform: "windows",
    arch: "x64",
    channel: "stable",
    notes: "",
    updateManifest: true,
    uploading: false,
    progress: 0,
    loadedBytes: 0,
    totalBytes: 0,
    status: "",
  });

  return { releases, notices, selectedNotice, noticeDraft, uploadDraft };
}
