import messages from '../../messages/pl.json';
import {demoUrls} from './demoUrls';
import type {DemoContent, FaqItem, FeatureItem, Stat} from '@/types/content';

type HomeMessages = typeof messages.home;
type DemoMessages = Omit<DemoContent, 'iframeUrl' | 'slug'> & {
  slug: string;
};

export const homeContent: HomeMessages = messages.home;

function createDemoContent(demo: DemoMessages, iframeUrl: string): DemoContent {
  return {
    ...demo,
    iframeUrl,
    slug: demo.slug as DemoContent['slug'],
    stats: demo.stats as Stat[],
    benefits: demo.benefits as FeatureItem[],
    faq: demo.faq as FaqItem[]
  };
}

export const demoContent = {
  room: createDemoContent(messages.demos.room, demoUrls.room),
  door: createDemoContent(messages.demos.door, demoUrls.door),
  desk: createDemoContent(messages.demos.desk, demoUrls.desk),
  dart: createDemoContent(messages.demos.dart, demoUrls.dart)
} as const;

export const orderedDemos: DemoContent[] = [demoContent.room, demoContent.door, demoContent.desk, demoContent.dart];

export const marketingFaq: FaqItem[] = messages.marketingFaq;
