- {filtersLoading ? (
+ {isFiltersLoading ? (
{t('common.loading')}
) : (
- Object.entries(groupedFilters).map(([group, filters]) => (
+ Object.entries(currentFilters).map(([group, filters]) => (
{FILTER_GROUP_LABEL_KEYS[group] ? t(FILTER_GROUP_LABEL_KEYS[group]) : group}
@@ -303,11 +455,7 @@ export default function AdminBroadcastCreate() {
{filters.map((filter) => (
- {/* Message text */}
-
-
-
-
- {/* Media upload */}
-
-
- {mediaFile ? (
-
-
-
- {mediaType === 'photo' &&
}
- {mediaType === 'video' &&
}
- {mediaType === 'document' &&
}
-
-
{mediaFile.name}
-
- {(mediaFile.size / 1024 / 1024).toFixed(2)} MB
-
-
-
-
-
- {mediaPreview && (
-

- )}
- {isUploading && (
-
-
- {t('admin.broadcasts.uploading')}
-
- )}
-
- ) : (
+ {/* Telegram-specific fields */}
+ {channel === 'telegram' && (
+ <>
+ {/* Message text */}
- )}
-
- {/* Buttons selection */}
-
-
-
- {buttonsData?.buttons.map((button) => (
-
- ))}
-
-
+ {/* Media upload */}
+
+
+ {mediaFile ? (
+
+
+
+ {mediaType === 'photo' &&
}
+ {mediaType === 'video' &&
}
+ {mediaType === 'document' &&
}
+
+
{mediaFile.name}
+
+ {(mediaFile.size / 1024 / 1024).toFixed(2)} MB
+
+
+
+
+
+ {mediaPreview && (
+

+ )}
+ {isUploading && (
+
+
+ {t('admin.broadcasts.uploading')}
+
+ )}
+
+ ) : (
+
+
+
+
+ )}
+
+
+ {/* Buttons selection */}
+
+
+
+ {buttonsData?.buttons.map((button) => (
+
+ ))}
+
+
+ >
+ )}
+
+ {/* Email-specific fields */}
+ {channel === 'email' && (
+ <>
+ {/* Email subject */}
+
+
+ setEmailSubject(e.target.value)}
+ placeholder={t('admin.broadcasts.emailSubjectPlaceholder')}
+ className="input"
+ maxLength={200}
+ />
+
+
+ {/* Email content */}
+
+
+
{t('admin.broadcasts.emailContentHint')}
+
+
+ {/* Email variables hint */}
+
+
+ {t('admin.broadcasts.emailVariables')}
+
+
+ {['{{user_name}}', '{{email}}', '{{user_id}}'].map((variable) => (
+
+ {variable}
+
+ ))}
+
+
+ >
+ )}
{/* Footer */}
@@ -443,7 +648,7 @@ export default function AdminBroadcastCreate() {