import { z } from 'zod';
import type { LocalizedText } from '@/server/page-layout/types';

export interface Config {
  title?: LocalizedText;
  source: 'subscribed-clubs' | 'featured' | 'ids';
  ids?: string[];
  limit: number;
}

export const configSchema: z.ZodType<Config> = z.object({
  title: z.object({ he: z.string(), en: z.string() }).optional(),
  source: z.enum(['subscribed-clubs', 'featured', 'ids']),
  ids: z.array(z.uuid()).max(30).optional(),
  limit: z.number().int().min(1).max(30),
});

export const defaultConfig: Config = {
  source: 'featured',
  limit: 10,
};

export const type = 'merchant-scroll' as const;
export const category = 'custom' as const;
export const labelKey = 'module_labels.merchant-scroll' as const;
