Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

1.0 KB
Raw Blame
import type { DialogSchema } from "./schemas";
import { ChangePasswordDialog } from "./auth/change-password";
import { DisableTwoFactorDialog } from "./auth/disable-two-factor";
import { EnableTwoFactorDialog } from "./auth/enable-two-factor";
import { SetPasswordDialog } from "./auth/set-password";
import { ResumeDialog } from "./resume";
import { NewDocumentDialog } from "@/features/documents/new-document-dialog";

export const renderDialog = (dialog: DialogSchema, mobileSheet = false) => {
	switch (dialog.type) {
		case "auth.change-password":
			return <ChangePasswordDialog />;
		case "auth.set-password":
			return <SetPasswordDialog />;
		case "auth.two-factor.enable":
			return <EnableTwoFactorDialog />;
		case "auth.two-factor.disable":
			return <DisableTwoFactorDialog />;
		case "document.new":
			return <NewDocumentDialog data={dialog.data} mobileSheet={mobileSheet} />;
		case "resume.update":
			return <ResumeDialog mode="update" data={dialog.data} />;
		case "resume.duplicate":
			return <ResumeDialog mode="duplicate" data={dialog.data} />;
	}
};