diff --git a/src/components/admin/builder/templates/DateScreenConfig.tsx b/src/components/admin/builder/templates/DateScreenConfig.tsx index b02a772..c733367 100644 --- a/src/components/admin/builder/templates/DateScreenConfig.tsx +++ b/src/components/admin/builder/templates/DateScreenConfig.tsx @@ -12,7 +12,10 @@ interface DateScreenConfigProps { export function DateScreenConfig({ screen, onUpdate }: DateScreenConfigProps) { const dateScreen = screen as DateScreenDefinition & { position: { x: number; y: number } }; - const handleDateInputChange = (field: T, value: string | boolean) => { + const handleDateInputChange = ( + field: T, + value: DateScreenDefinition["dateInput"][T] + ) => { onUpdate({ dateInput: { ...dateScreen.dateInput, @@ -21,6 +24,30 @@ export function DateScreenConfig({ screen, onUpdate }: DateScreenConfigProps) { }); }; + const handleZodiacSettingsChange = ( + updates: Partial> + ) => { + const currentZodiac = dateScreen.dateInput?.zodiac ?? { + enabled: false, + storageKey: "", + }; + + const nextZodiac = { + ...currentZodiac, + ...updates, + }; + + const shouldRemove = + (nextZodiac.enabled ?? false) === false && (nextZodiac.storageKey ?? "") === ""; + + onUpdate({ + dateInput: { + ...dateScreen.dateInput, + zodiac: shouldRemove ? undefined : nextZodiac, + }, + }); + }; + const handleInfoMessageChange = (field: "text" | "icon", value: string) => { const baseInfo = dateScreen.infoMessage ?? { text: "", icon: "ℹ️" }; const nextInfo = { ...baseInfo, [field]: value }; @@ -99,6 +126,37 @@ export function DateScreenConfig({ screen, onUpdate }: DateScreenConfigProps) { Показывать выбранную дату под полем +
+
+ + handleZodiacSettingsChange({ enabled: event.target.checked }) + } + /> + Автоматически определять знак зодиака +
+ +

+ Если включено, система вычислит знак зодиака по выбранной дате и сохранит его по + указанному ключу. Значение можно использовать в правилах навигации и вариативности. +

+ + {dateScreen.dateInput?.zodiac?.enabled && ( + + )} +
+