⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
import type { WorkspaceUsage } from "@/constants/onboarding";
export type OnboardingStepId =
| "workspace"
| "usage"
| "project"
| "invite"
| "plan"
| "ready";
type StepOptions = {
usage: WorkspaceUsage;
canInvite: boolean;
offersPlan: boolean;
};
export function getOnboardingSteps({
usage,
canInvite,
offersPlan,
}: StepOptions): OnboardingStepId[] {
const steps: OnboardingStepId[] = ["workspace", "usage", "project"];
if (usage === "team" && canInvite) steps.push("invite");
steps.push(offersPlan ? "plan" : "ready");
return steps;
}
export function getStepProgress(
steps: OnboardingStepId[],
current: OnboardingStepId,
) {
const counted: OnboardingStepId[] = steps.filter((step) => step !== "ready");
return {
current: counted.indexOf(current) + 1,
total: counted.length,
};
}
export function getNextStep(
steps: OnboardingStepId[],
current: OnboardingStepId,
): OnboardingStepId {
return steps[steps.indexOf(current) + 1] ?? "ready";
}