import type { BuilderScreen } from "@/lib/admin/builder/types";
import type { ArrowHintDefinition, AccentedOptionSetting } from "@/lib/funnel/types";
import {
  buildDefaultHeader,
  buildDefaultTitle,
  buildDefaultSubtitle,
  buildDefaultBottomActionButton,
  buildDefaultNavigation,
} from "./blocks";

export function buildDefaultArrowHint(
  overrides?: Partial<ArrowHintDefinition>
): ArrowHintDefinition {
  return {
    text: "It costs us {{maxTrialPrice}} to compensate our team for the work involved in creating your personalized portrait and guide, but please choose the amount you are comfortable with.",
    position: "bottom-right",
    ...overrides,
  };
}

export const DEFAULT_ACCENTED_OPTION: AccentedOptionSetting = "server";

export function buildTrialChoiceDefaults(id: string): BuilderScreen {
  return {
    id,
    template: "trialChoice",
    header: buildDefaultHeader({
      showProgress: false,
    }),
    title: buildDefaultTitle({
      show: false,
      text: "Trial Choice",
    }),
    subtitle: buildDefaultSubtitle({
      show: false,
      text: undefined,
    }),
    arrowHint: buildDefaultArrowHint(),
    accentedOption: DEFAULT_ACCENTED_OPTION,
    bottomActionButton: buildDefaultBottomActionButton({
      text: "Next",
    }),
    navigation: buildDefaultNavigation(),
  } as BuilderScreen;
}
