import { Meta, StoryObj } from "@storybook/nextjs-vite"; import { SoulmatePortraitTemplate } from "./SoulmatePortraitTemplate"; import { fn } from "storybook/test"; import { buildSoulmateDefaults } from "@/lib/admin/builder/state/defaults/soulmate"; import type { SoulmatePortraitScreenDefinition } from "@/lib/funnel/types"; // Получаем дефолтные значения из builder const defaultScreen = buildSoulmateDefaults("soulmate-screen-story") as SoulmatePortraitScreenDefinition; /** SoulmatePortraitTemplate - результирующие экраны с портретом партнера */ const meta: Meta = { title: "Funnel Templates/SoulmatePortraitTemplate", component: SoulmatePortraitTemplate, tags: ["autodocs"], parameters: { layout: "fullscreen", }, args: { screen: defaultScreen, onContinue: fn(), canGoBack: true, onBack: fn(), screenProgress: { current: 10, total: 10 }, // Обычно финальный экран defaultTexts: { nextButton: "Next", }, }, argTypes: { screen: { control: { type: "object" }, }, screenProgress: { control: { type: "object" }, }, onContinue: { action: "continue" }, onBack: { action: "back" }, }, }; export default meta; type Story = StoryObj; /** Дефолтный soulmate portrait экран */ export const Default: Story = {}; /** Экран без описания */ export const WithoutDescription: Story = { args: { screen: { ...defaultScreen, description: undefined, }, }, }; /** Экран с кастомным описанием */ export const CustomDescription: Story = { args: { screen: { ...defaultScreen, description: { text: "На основе ваших ответов мы создали уникальный **портрет вашей второй половинки**. Этот анализ поможет вам лучше понять, кто может стать идеальным партнером.", font: "inter", weight: "regular", align: "center", size: "md", color: "default", }, }, }, }; /** Экран без header */ export const WithoutHeader: Story = { args: { screen: { ...defaultScreen, header: { show: false, }, }, }, }; /** Экран без subtitle */ export const WithoutSubtitle: Story = { args: { screen: { ...defaultScreen, subtitle: undefined, // Просто удаляем subtitle }, }, }; /** Финальный экран (без прогресса) */ export const FinalScreen: Story = { args: { screen: { ...defaultScreen, header: { show: true, showBackButton: false, // На финальном экране обычно нет кнопки назад showProgress: false, // И нет прогресса }, }, screenProgress: undefined, canGoBack: false, }, };