import type { FormPreset, EmailPreset } from './types';
import { __ } from '@wordpress/i18n';

export interface EmailFontOption {
	value: string;
	label: string;
	group: 'Email-safe fonts';
	stack: string;
}

export const EMAIL_FONT_OPTIONS: EmailFontOption[] = [
	{ value: 'system', label: 'System sans', group: 'Email-safe fonts', stack: '-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif' },
	{ value: 'serif', label: 'Editorial serif', group: 'Email-safe fonts', stack: 'Georgia,Cambria,"Times New Roman",Times,serif' },
	{ value: 'geometric', label: 'Geometric sans', group: 'Email-safe fonts', stack: 'Avenir Next,Avenir,Montserrat,Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif' },
	{ value: 'mono', label: 'Mono', group: 'Email-safe fonts', stack: 'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace' },
	{ value: 'arial', label: 'Arial', group: 'Email-safe fonts', stack: 'Arial,Helvetica,sans-serif' },
	{ value: 'verdana', label: 'Verdana', group: 'Email-safe fonts', stack: 'Verdana,Geneva,sans-serif' },
	{ value: 'tahoma', label: 'Tahoma', group: 'Email-safe fonts', stack: 'Tahoma,Geneva,sans-serif' },
	{ value: 'trebuchet', label: 'Trebuchet MS', group: 'Email-safe fonts', stack: '"Trebuchet MS",Tahoma,sans-serif' },
	{ value: 'georgia', label: 'Georgia', group: 'Email-safe fonts', stack: 'Georgia,serif' },
	{ value: 'palatino', label: 'Palatino', group: 'Email-safe fonts', stack: 'Palatino,"Palatino Linotype",Georgia,serif' },
	{ value: 'courier', label: 'Courier New', group: 'Email-safe fonts', stack: '"Courier New",Courier,monospace' },
];

export const EMAIL_FONT_STACKS = EMAIL_FONT_OPTIONS.reduce<Record<string, string>>((acc, option) => {
	acc[option.value] = option.stack;
	return acc;
}, {});

export const EMAIL_FONT_VALUES = EMAIL_FONT_OPTIONS.map((option) => option.value);

export const FORM_TEXT_DEFAULTS = {
	form_title: __( 'Notify Me When Available', 'stockbeacon-product-waitlists-for-woocommerce' ),
	form_description: __( "Enter your email and we'll let you know when this product is back in stock.", 'stockbeacon-product-waitlists-for-woocommerce' ),
	form_button_text: __( 'Notify Me', 'stockbeacon-product-waitlists-for-woocommerce' ),
	form_placeholder: __( 'Enter your email address', 'stockbeacon-product-waitlists-for-woocommerce' ),
	form_success_message: __( "You're on the list! We'll email you when this item is restocked.", 'stockbeacon-product-waitlists-for-woocommerce' ),
};
