import { m } from '@paraglide/messages';
import z from 'zod';

export const settingSchema = z.object({
  site_name: z.string().nonempty(
    m.common_is_required({
      field: m.settings_form_name(),
    }),
  ),
  site_description: z.string().nonempty(
    m.common_is_required({
      field: m.settings_form_description(),
    }),
  ),
  site_keywords: z.string().nonempty(
    m.common_is_required({
      field: m.settings_form_keywords(),
    }),
  ),
});

export type SettingsInput = z.infer<typeof settingSchema>;

export const userSettingSchema = z.object({
  language: z.string().nonempty(
    m.common_is_required({
      field: m.settings_form_language(),
    }),
  ),
});

export type UserSettingInput = z.infer<typeof userSettingSchema>;
