import 'server-only';

import dynamic from 'next/dynamic';
import { ComponentType } from 'react';
import { WidgetResultType } from '@akinon/next/types';

export const HOME_WIDGETS: {
  [key: string]: ComponentType<WidgetResultType<unknown>>;
} = {
  'home-hero-slider': dynamic(
    async () => import('@theme/widgets/home-hero-slider')
  ),
  'home-product-recommendation': dynamic(
    async () => import('@theme/widgets/home-product-recommendation')
  ),
  'home-discovery': dynamic(
    async () => import('@theme/widgets/home-discovery')
  ),
  'product-pointer-banners': dynamic(
    async () => import('@theme/widgets/product-pointer-banners')
  ),
  'home-storieseng': dynamic(
    async () => import('@theme/widgets/home-stories-eng')
  )
};

export const FLATPAGE_COMPONENT: {
  [key: string]: ComponentType<WidgetResultType<unknown>>;
} = {
  'about-us': dynamic(async () => import('@theme/widgets/flatpages/about-us')),
  'blog-list': dynamic(async () => import('@theme/widgets/flatpages/blog-list'))
};
