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

export interface CategoryChip {
  slug: string;
  label: LocalizedText;
}

export interface Config {
  categories: CategoryChip[];
}

export const configSchema: z.ZodType<Config> = z.object({
  categories: z.array(
    z.object({
      slug: z.string().min(1),
      label: z.object({ he: z.string().min(1), en: z.string().min(1) }),
    }),
  ),
});

export const defaultConfig: Config = {
  categories: [
    { slug: 'meal', label: { he: 'ארוחה', en: 'Meal' } },
    { slug: 'bakery', label: { he: 'מאפייה', en: 'Bakery' } },
    { slug: 'beverage', label: { he: 'שתייה', en: 'Beverage' } },
    { slug: 'dessert', label: { he: 'קינוח', en: 'Dessert' } },
    { slug: 'packaged', label: { he: 'ארוז', en: 'Packaged' } },
  ],
};

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