import { Progress } from "@kobalte/core";
import { Show } from "solid-js";
import { useMegaStore } from "~/state/megaStore";
export function LoadingBar(props: { value: number; max: number }) {
function valueToStage(value: number) {
switch (value) {
case 0:
return "Just getting started";
case 1:
return "Checking user status";
case 2:
return "Double checking something";
case 3:
return "Downloading";
case 4:
return "Setup";
case 5:
return "Done";
default:
return "Just getting started";
}
}
return (
`Loading: ${valueToStage(value)}`}
class="w-full flex flex-col gap-2"
>
);
}
export function LoadingIndicator() {
const [state, _actions] = useMegaStore();
const loadStageValue = () => {
switch (state.load_stage) {
case "fresh":
return 0;
case "checking_user":
return 1;
case "checking_double_init":
return 2;
case "downloading":
return 3;
case "setup":
return 4;
case "done":
return 5;
default:
return 0;
}
};
return (
);
}