diff --git a/mailpoet/assets/js/src/form_editor/components/font_family_settings.tsx b/mailpoet/assets/js/src/form_editor/components/font_family_settings.tsx index 4801f59133..fbd122638e 100644 --- a/mailpoet/assets/js/src/form_editor/components/font_family_settings.tsx +++ b/mailpoet/assets/js/src/form_editor/components/font_family_settings.tsx @@ -15,6 +15,14 @@ const standardFonts = [ 'Verdana', ]; +type Option = { + key: string; + name: string; + selectable: boolean; + value?: string; + style?: CSSProperties; +}; + type Props = { onChange: (value: string | undefined) => void; value?: string; @@ -42,7 +50,7 @@ export function FontFamilySettings({ cursor: 'default', marginLeft: 16, }); - const options = [ + const options: Option[] = [ { key: MailPoet.I18n.t('formFontsDefaultTheme'), name: MailPoet.I18n.t('formFontsDefaultTheme'), @@ -90,8 +98,9 @@ export function FontFamilySettings({ { - if (selected.selectedItem.selectable) { - onChange(selected.selectedItem.value as string); + const selectedItem = selected.selectedItem as Option; + if (selectedItem.selectable) { + onChange(selectedItem.value); } }} value={selectedValue}