import { Colors } from "~/application/enums/shared/Colors"; import { t as i18nT } from "i18next"; import { OnboardingGridDto } from "./grid/OnboardingGridUtils"; export type OnboardingBlockDto = { style: OnboardingBlockStyle; title: string; canBeDismissed: boolean; height: OnboardingHeightDto; steps: OnboardingStepBlockDto[]; }; export type OnboardingHeightDto = "xs" | "sm" | "md" | "lg" | "xl" | "auto"; export interface OnboardingStepBlockDto { id: string; title: string; description?: string; links: OnboardingLinkDto[]; gallery: OnboardingGalleryDto[]; input: OnboardingInputDto[]; inputGrid?: OnboardingGridDto; icon?: string; completedAt?: Date | null; } interface OnboardingLinkDto { text: string; href: string; isPrimary: boolean; target?: string; } interface OnboardingGalleryDto { id: string; type: "image" | "video"; title: string; src: string; } export interface OnboardingInputOptionDto { name: string; value: string; color?: Colors; } interface OnboardingInputDto { id: string; type: "text" | "select"; name: string; title: string; isRequired: boolean; options: OnboardingInputOptionDto[]; } export const OnboardingBlockStyles = [{ value: "modal", name: "Modal" }] as const; export type OnboardingBlockStyle = (typeof OnboardingBlockStyles)[number]["value"]; export const defaultOnboardingStepBlock: OnboardingStepBlockDto = { id: "", title: i18nT("onboarding.block.defaults.stepTitle"), description: i18nT("onboarding.block.defaults.stepDescription"), icon: ` `, links: [ { text: i18nT("onboarding.block.defaults.primaryLink"), href: "#", isPrimary: true, }, { text: i18nT("onboarding.block.defaults.secondaryLink"), href: "#", isPrimary: false, }, ], gallery: [ { id: "", type: "image", title: i18nT("onboarding.block.defaults.gallery.image1"), src: "https://placehold.co/1000x600?text=Image%201", }, { id: "", type: "image", title: i18nT("onboarding.block.defaults.gallery.image2"), src: "https://placehold.co/1000x600?text=Image%202", }, ], input: [ { id: "1", type: "text", name: "source", title: i18nT("onboarding.block.defaults.sourceQuestion"), isRequired: true, options: [], }, { id: "2", type: "select", name: "What will you use it for?", title: i18nT("onboarding.block.defaults.useCaseSelect"), isRequired: false, options: [ { value: "research", name: i18nT("onboarding.block.defaults.useCases.research"), color: Colors.GRAY }, { value: "personal", name: i18nT("onboarding.block.defaults.useCases.personal"), color: Colors.BLUE }, { value: "smallBusiness", name: i18nT("onboarding.block.defaults.useCases.smallBusiness"), color: Colors.INDIGO }, { value: "largeCompany", name: i18nT("onboarding.block.defaults.useCases.largeCompany"), color: Colors.VIOLET }, ], }, ], }; export const defaultOnboardingBlock: OnboardingBlockDto = { style: "modal", title: i18nT("onboarding.block.defaults.title"), canBeDismissed: true, height: "md", steps: [defaultOnboardingStepBlock], };